Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35b672d

Browse files
committed
GitObject.Peel: restore null check on handle
1 parent 5ff6b73 commit 35b672d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

LibGit2Sharp/GitObject.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ internal T Peel<T>(bool throwOnError) where T : GitObject
101101

102102
using (var handle = Proxy.git_object_peel(repo.Handle, Id, kind, throwOnError))
103103
{
104+
if (handle == null)
105+
{
106+
return null;
107+
}
108+
104109
return (T)BuildFrom(this.repo, Proxy.git_object_id(handle), kind, null);
105110
}
106111
}

0 commit comments

Comments
 (0)