mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +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(),
|
op.WithPretty(),
|
||||||
)
|
)
|
||||||
|
|
||||||
if !res.IsError() {
|
if res != nil && !res.IsError() {
|
||||||
return true, nil
|
return true, nil
|
||||||
} else if res.StatusCode == 404 {
|
} else if res != nil && res.StatusCode == 404 {
|
||||||
return false, nil
|
return false, nil
|
||||||
} else {
|
} else {
|
||||||
return false, idx.responseErrorOrNil(
|
return false, idx.responseErrorOrNil(
|
||||||
|
|||||||
Reference in New Issue
Block a user