Skip to content

Commit b0ee859

Browse files
Merge pull request #917 from openshift-cherrypick-robot/cherry-pick-909-to-release-4.14
[release-4.14] OCPBUGS-18794: check if response is nil before using it
2 parents 4d68ce9 + ec92a33 commit b0ee859

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/storage/ibmcos/ibmcos.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,11 @@ func (d *driver) VolumeSecrets() (map[string]string, error) {
804804
},
805805
)
806806
if err != nil {
807-
return nil, fmt.Errorf("unable to get resource key for service instance: %s with resp code: %d", err.Error(), resp.StatusCode)
807+
respMsg := ""
808+
if resp != nil {
809+
respMsg = fmt.Sprintf(" with resp code: %d", resp.StatusCode)
810+
}
811+
return nil, fmt.Errorf("unable to get resource key for service instance: %s%s", err.Error(), respMsg)
808812
}
809813

810814
var accessKey string

0 commit comments

Comments
 (0)