Skip to content

Commit

Permalink
peel_onion: handle NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Martin Koegler authored and Junio C Hamano committed Feb 19, 2008
1 parent dec38c8 commit f73df33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,11 @@ static int peel_onion(const char *name, int len, unsigned char *sha1)
return error("%.*s: expected %s type, but the object dereferences to %s type",
len, name, typename(expected_type),
typename(o->type));
if (!o)
return -1;
if (!o->parsed)
parse_object(o->sha1);
if (!parse_object(o->sha1))
return -1;
}
}
return 0;
Expand Down

0 comments on commit f73df33

Please sign in to comment.