summaryrefslogtreecommitdiff
path: root/remote.go
diff options
context:
space:
mode:
Diffstat (limited to 'remote.go')
-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)
}