deref_tag: handle tag->tagged = NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin Koegler committed
Feb 18, 2008 at 08:31 UTC
24e8a3c946d158c977b67c346c21abc609c63209
1 file changed
+4
-1
tag.c
+4
-1
@@ -9,7 +9,10 @@ const char *tag_type = "tag";
9
struct object *deref_tag(struct object *o, const char *warn, int warnlen)
10
{
11
while (o && o->type == OBJ_TAG)
12
- o = parse_object(((struct tag *)o)->tagged->sha1);
12
+ if (((struct tag *)o)->tagged)
13
+ o = parse_object(((struct tag *)o)->tagged->sha1);
14
+ else
15
+ o = NULL;
16
if (!o && warn) {
17
if (!warnlen)
18
warnlen = strlen(warn);