X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=shallow.c;h=4d90eda19efe0a80c1cb39e8897ab3ed5e6fcf56;hb=8718e875080767f2c8d06c55c3fb5a6dddf0e5a0;hp=ab975482d0571fa4b647bb3bc9f5032947dc0f3e;hpb=dec38c81657f02624752a65c24d72613316713f5;p=git.git diff --git a/shallow.c b/shallow.c index ab975482d..4d90eda19 100644 --- a/shallow.c +++ b/shallow.c @@ -56,7 +56,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth, if (i < heads->nr) { commit = (struct commit *) deref_tag(heads->objects[i++].item, NULL, 0); - if (commit->object.type != OBJ_COMMIT) { + if (!commit || commit->object.type != OBJ_COMMIT) { commit = NULL; continue; }