Skip to content

Commit

Permalink
mark_blob/tree_uninteresting: check for NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Koegler authored and Junio C Hamano committed Feb 19, 2008
1 parent 283cdbc commit c1ee901
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit c1ee901

Please sign in to comment.