diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-05-01 23:55:36 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-05-01 23:55:36 +0400 |
commit | d2116674f334ab5a6b707daa941c708e16194b6a (patch) | |
tree | 3634f514ac2590d17aec0d5eef113bda3ab262cf /LibGit2Sharp/Reference.cs | |
parent | a2f93dd403d0b4f6e0ea17530ea43bb9ba060639 (diff) |
Port some tests from cgit and fix implementation to make them pass
Diffstat (limited to 'LibGit2Sharp/Reference.cs')
-rw-r--r-- | LibGit2Sharp/Reference.cs | 5 |
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); |