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>
This commit is contained in:

committed by
Junio C Hamano

parent
283cdbcf49
commit
c1ee9013ad
@ -46,6 +46,8 @@ void add_object(struct object *obj,
|
|||||||
|
|
||||||
static void mark_blob_uninteresting(struct blob *blob)
|
static void mark_blob_uninteresting(struct blob *blob)
|
||||||
{
|
{
|
||||||
|
if (!blob)
|
||||||
|
return;
|
||||||
if (blob->object.flags & UNINTERESTING)
|
if (blob->object.flags & UNINTERESTING)
|
||||||
return;
|
return;
|
||||||
blob->object.flags |= UNINTERESTING;
|
blob->object.flags |= UNINTERESTING;
|
||||||
@ -57,6 +59,8 @@ void mark_tree_uninteresting(struct tree *tree)
|
|||||||
struct name_entry entry;
|
struct name_entry entry;
|
||||||
struct object *obj = &tree->object;
|
struct object *obj = &tree->object;
|
||||||
|
|
||||||
|
if (!tree)
|
||||||
|
return;
|
||||||
if (obj->flags & UNINTERESTING)
|
if (obj->flags & UNINTERESTING)
|
||||||
return;
|
return;
|
||||||
obj->flags |= UNINTERESTING;
|
obj->flags |= UNINTERESTING;
|
||||||
|
Reference in New Issue
Block a user