Add nil check on CredentialsCallback wrapper
This commit is contained in:
parent
a572b15df6
commit
803ef7dad5
|
@ -214,7 +214,9 @@ func credentialsCallback(_cred **C.git_cred, _url *C.char, _username_from_url *C
|
||||||
url := C.GoString(_url)
|
url := C.GoString(_url)
|
||||||
username_from_url := C.GoString(_username_from_url)
|
username_from_url := C.GoString(_username_from_url)
|
||||||
ret, cred := callbacks.CredentialsCallback(url, username_from_url, (CredType)(allowed_types))
|
ret, cred := callbacks.CredentialsCallback(url, username_from_url, (CredType)(allowed_types))
|
||||||
|
if cred != nil {
|
||||||
*_cred = cred.ptr
|
*_cred = cred.ptr
|
||||||
|
}
|
||||||
return int(ret)
|
return int(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue