From: Martin Koegler Date: Mon, 18 Feb 2008 20:48:02 +0000 (+0100) Subject: parse_commit: don't fail, if object is NULL X-Git-Tag: v1.5.5-rc0~93^2~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9786f68bfcc082778aee74159540e341bb239514;p=git.git parse_commit: don't fail, if object is NULL Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit) can pass NULL. Signed-off-by: Martin Koegler Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index 70f12664c..5d57450de 100644 --- a/commit.c +++ b/commit.c @@ -311,6 +311,8 @@ int parse_commit(struct commit *item) unsigned long size; int ret; + if (!item) + return -1; if (item->object.parsed) return 0; buffer = read_sha1_file(item->object.sha1, &type, &size);