From affeef12fb2d10317fbcc7a866fbc3603cf16119 Mon Sep 17 00:00:00 2001 From: Martin Koegler Date: Mon, 18 Feb 2008 08:31:54 +0100 Subject: deref_tag: handle return value NULL Signed-off-by: Martin Koegler Signed-off-by: Junio C Hamano --- shallow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shallow.c') diff --git a/shallow.c b/shallow.c index dbd9f5ad0a..212e62b77c 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; } -- cgit v1.2.1