We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e6e98ba + 11c700d commit 16aaf6cCopy full SHA for 16aaf6c
1 file changed
LibGit2Sharp/TreeDefinition.cs
@@ -310,7 +310,12 @@ internal Tree Build(Repository repository)
310
builtTreeEntryDefinitions.ForEach(t => entries[t.Item1] = t.Item2);
311
312
ObjectId treeId = builder.Write();
313
- return repository.Lookup<Tree>(treeId);
+ var result = repository.Lookup<Tree>(treeId);
314
+ if (result == null)
315
+ {
316
+ throw new LibGit2SharpException("Unable to read created tree");
317
+ }
318
+ return result;
319
}
320
321
0 commit comments