summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-02-18 21:47:58 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-18 20:49:18 -0800
commitf73df331a43a6092af427fd30bb6ce07f313743c (patch)
treed698adae5a1285d996b60153b63bd3a798589675 /sha1_name.c
parentdec38c81657f02624752a65c24d72613316713f5 (diff)
downloadgit-f73df331a43a6092af427fd30bb6ce07f313743c.tar.gz
peel_onion: handle NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 4c0bc9c5b5..2575ea77f4 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;