deref_tag: handle return value NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin Koegler
2008-02-18 08:31:54 +01:00
committed by Junio C Hamano
parent 9886ea417b
commit affeef12fb
5 changed files with 12 additions and 3 deletions

View File

@ -575,7 +575,8 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
}
if (o->type == OBJ_TAG) {
o = deref_tag(o, refname, 0);
packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
if (o)
packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
}
return 0;
}