summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron O'Mullan <[email protected]>2015-08-24 21:37:09 +0200
committerCarlos Martín Nieto <[email protected]>2015-08-31 12:48:11 +0200
commit803ef7dad548b1b84c86365d6b61c8b6b4a0cce0 (patch)
tree3d81ace645ad46657e91385a21c8ebe3ab6991ae
parenta572b15df69c4b0350a1134045a7e7a66b06de21 (diff)
Add nil check on CredentialsCallback wrapper
-rw-r--r--remote.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/remote.go b/remote.go
index e1e4845..b2fb96f 100644
--- a/remote.go
+++ b/remote.go
@@ -214,7 +214,9 @@ func credentialsCallback(_cred **C.git_cred, _url *C.char, _username_from_url *C
url := C.GoString(_url)
username_from_url := C.GoString(_username_from_url)
ret, cred := callbacks.CredentialsCallback(url, username_from_url, (CredType)(allowed_types))
- *_cred = cred.ptr
+ if cred != nil {
+ *_cred = cred.ptr
+ }
return int(ret)
}