mark_blob/tree_uninteresting: check for NULL
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>
Mon, 18 Feb 2008 20:47:54 +0000 (21:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Feb 2008 03:20:20 +0000 (19:20 -0800)
As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c

index 6e85aaa3fb30e98f3b02f094af7f1763577cdb8d..484e5e7959d4583ed474e81f3a39e4569f2c7b76 100644 (file)
@@ -46,6 +46,8 @@ void add_object(struct object *obj,
 
 static void mark_blob_uninteresting(struct blob *blob)
 {
+       if (!blob)
+               return;
        if (blob->object.flags & UNINTERESTING)
                return;
        blob->object.flags |= UNINTERESTING;
@@ -57,6 +59,8 @@ void mark_tree_uninteresting(struct tree *tree)
        struct name_entry entry;
        struct object *obj = &tree->object;
 
+       if (!tree)
+               return;
        if (obj->flags & UNINTERESTING)
                return;
        obj->flags |= UNINTERESTING;