deref_tag: handle return value NULL
[gitweb.git] / sha1_name.c
index be8489e4e5fc98c6e38036a40fb5ca8c0db77ebc..ed3c867d6ad5ed181033950fbcca8daa605e6f20 100644 (file)
@@ -578,8 +578,11 @@ static int handle_one_ref(const char *path,
        struct object *object = parse_object(sha1);
        if (!object)
                return 0;
-       if (object->type == OBJ_TAG)
+       if (object->type == OBJ_TAG) {
                object = deref_tag(object, path, strlen(path));
+               if (!object)
+                       return 0;
+       }
        if (object->type != OBJ_COMMIT)
                return 0;
        insert_by_date((struct commit *)object, list);