Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Dahlby <dahlbyk@gmail.com>2013-03-03 04:42:10 +0400
committernulltoken <emeric.fermas@gmail.com>2013-04-11 21:22:42 +0400
commit6fd43ffaf7038625fb0dd5ca03cdee3490c146d9 (patch)
treec2c8a3b7d8676b45a2a0c190426b1f249e2e4ac6 /LibGit2Sharp/Core/Handles
parent3f35bbbeaaf8cb1dd5a4a3e65cae59a5a85ce5ab (diff)
Guard against marshaling invalid handle as GitOid
Related: https://bugzilla.xamarin.com/show_bug.cgi?id=11417
Diffstat (limited to 'LibGit2Sharp/Core/Handles')
-rw-r--r--LibGit2Sharp/Core/Handles/OidSafeHandle.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/LibGit2Sharp/Core/Handles/OidSafeHandle.cs b/LibGit2Sharp/Core/Handles/OidSafeHandle.cs
index a88673a4..bc3ce6a7 100644
--- a/LibGit2Sharp/Core/Handles/OidSafeHandle.cs
+++ b/LibGit2Sharp/Core/Handles/OidSafeHandle.cs
@@ -6,7 +6,7 @@ namespace LibGit2Sharp.Core.Handles
{
private GitOid? MarshalAsGitOid()
{
- return (GitOid?)Marshal.PtrToStructure(handle, typeof(GitOid));
+ return IsInvalid ? null : (GitOid?)Marshal.PtrToStructure(handle, typeof(GitOid));
}
public ObjectId MarshalAsObjectId()