diff mbox series

line-log: handle deref_tag() returning NULL

Message ID 90968bb8-61da-e31e-e697-97cbe048e73e@web.de (mailing list archive)
State Accepted
Commit 5eb2ed691b809a55b024b8c10739254ea2ac48b7
Headers show
Series line-log: handle deref_tag() returning NULL | expand

Commit Message

René Scharfe Oct. 11, 2020, 4:03 p.m. UTC
Signed-off-by: René Scharfe <l.s.r@web.de>
---
 line-log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.28.0
diff mbox series

Patch

diff --git a/line-log.c b/line-log.c
index 68eeb425f8..75c8b1acff 100644
--- a/line-log.c
+++ b/line-log.c
@@ -481,7 +481,7 @@  static struct commit *check_single_commit(struct rev_info *revs)
 		if (obj->flags & UNINTERESTING)
 			continue;
 		obj = deref_tag(revs->repo, obj, NULL, 0);
-		if (obj->type != OBJ_COMMIT)
+		if (!obj || obj->type != OBJ_COMMIT)
 			die("Non commit %s?", revs->pending.objects[i].name);
 		if (commit)
 			die("More than one commit to dig from: %s and %s?",