]> git.ipfire.org Git - thirdparty/git.git/blobdiff - commit.c
Merge branch 'sb/userdiff-dts'
[thirdparty/git.git] / commit.c
index 3fe5f8fa9c6e95e966bbebca3159e24595e1ee48..40890ae7ce8a48a2da06bcde6fc5a9db77260707 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -358,7 +358,8 @@ struct tree *repo_get_commit_tree(struct repository *r,
 
 struct object_id *get_commit_tree_oid(const struct commit *commit)
 {
-       return &get_commit_tree(commit)->object.oid;
+       struct tree *tree = get_commit_tree(commit);
+       return tree ? &tree->object.oid : NULL;
 }
 
 void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)