Skip to content

Commit 208a488

Browse files
Merge pull request #909 from flavianmissi/OCPBUGS-18103
OCPBUGS-18103: check if response is nil before using it
2 parents 4d68ce9 + a501416 commit 208a488

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)