Skip to content

Commit ec92a33

Browse files
flavianmissiopenshift-cherrypick-robot
authored andcommitted
pkg/storage/ibmcos: check if response is nil before using it
1 parent 4d68ce9 commit ec92a33

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)