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

@ -56,7 +56,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
if (i < heads->nr) {
commit = (struct commit *)
deref_tag(heads->objects[i++].item, NULL, 0);
if (commit->object.type != OBJ_COMMIT) {
if (!commit || commit->object.type != OBJ_COMMIT) {
commit = NULL;
continue;
}