Fix nuill pointer dereference
This commit is contained in:
parent
c5985ee1a3
commit
adfb859419
|
@ -86,6 +86,9 @@ func (statusList *StatusList) ByIndex(index int) (StatusEntry, error) {
|
|||
return StatusEntry{}, ErrInvalid
|
||||
}
|
||||
ptr := C.git_status_byindex(statusList.ptr, C.size_t(index))
|
||||
if ptr == nil {
|
||||
return StatusEntry{}, MakeGitError(C.int(ErrNotFound))
|
||||
}
|
||||
entry := statusEntryFromC(ptr)
|
||||
runtime.KeepAlive(statusList)
|
||||
|
||||
|
|
Loading…
Reference in New Issue