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:
authornulltoken <emeric.fermas@gmail.com>2011-05-01 23:55:36 +0400
committernulltoken <emeric.fermas@gmail.com>2011-05-01 23:55:36 +0400
commitd2116674f334ab5a6b707daa941c708e16194b6a (patch)
tree3634f514ac2590d17aec0d5eef113bda3ab262cf /LibGit2Sharp/Reference.cs
parenta2f93dd403d0b4f6e0ea17530ea43bb9ba060639 (diff)
Port some tests from cgit and fix implementation to make them pass
Diffstat (limited to 'LibGit2Sharp/Reference.cs')
-rw-r--r--LibGit2Sharp/Reference.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs
index 7ba3f044..cabeca1d 100644
--- a/LibGit2Sharp/Reference.cs
+++ b/LibGit2Sharp/Reference.cs
@@ -19,6 +19,11 @@ namespace LibGit2Sharp
internal static T BuildFromPtr<T>(IntPtr ptr, Repository repo) where T : class
{
+ if (ptr == IntPtr.Zero)
+ {
+ return default(T);
+ }
+
var name = NativeMethods.git_reference_name(ptr);
var type = NativeMethods.git_reference_type(ptr);