@matheusbsbs / matheus-bagliano / commits / c1ee9013ad
Fork 0

mark_blob/tree_uninteresting: check for NULL

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>

Martin Koegler committed Feb 18, 2008 at 21:47 UTC c1ee9013ad5acfff47a36899af7d485f6d60fa83
1 file changed +4
revision.c
+4
@@ -46,6 +46,8 @@ void add_object(struct object *obj,
46
47 static void mark_blob_uninteresting(struct blob *blob)
48 {
49 + if (!blob)
50 + return;
51 if (blob->object.flags & UNINTERESTING)
52 return;
53 blob->object.flags |= UNINTERESTING;
@@ -57,6 +59,8 @@ void mark_tree_uninteresting(struct tree *tree)
59 struct name_entry entry;
60 struct object *obj = &tree->object;
61
62 + if (!tree)
63 + return;
64 if (obj->flags & UNINTERESTING)
65 return;
66 obj->flags |= UNINTERESTING;