Add nil check on CredentialsCallback wrapper

This commit is contained in:
Aaron O'Mullan 2015-08-24 21:37:09 +02:00 committed by Carlos Martín Nieto
parent a572b15df6
commit 803ef7dad5
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}