mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Check whether a pointer is empty before accessing it to avoid SIGSEGV
This commit is contained in:
@@ -309,9 +309,9 @@ func (idx *index) Exists(id string) (bool, error) {
|
||||
op.WithPretty(),
|
||||
)
|
||||
|
||||
if !res.IsError() {
|
||||
if res != nil && !res.IsError() {
|
||||
return true, nil
|
||||
} else if res.StatusCode == 404 {
|
||||
} else if res != nil && res.StatusCode == 404 {
|
||||
return false, nil
|
||||
} else {
|
||||
return false, idx.responseErrorOrNil(
|
||||
|
||||
Reference in New Issue
Block a user