From: Martin Koegler Date: Mon, 18 Feb 2008 20:47:58 +0000 (+0100) Subject: peel_onion: handle NULL X-Git-Tag: v1.5.5-rc0~93^2~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f73df331a43a6092af427fd30bb6ce07f313743c;p=git.git peel_onion: handle NULL Signed-off-by: Martin Koegler Signed-off-by: Junio C Hamano --- diff --git a/sha1_name.c b/sha1_name.c index 4c0bc9c5b..2575ea77f 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -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;