Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
don't crash when resp in nil (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
lokulin authored Sep 15, 2022
1 parent 7011169 commit 58c0a0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion okta/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ func AwsSamlLogin(oktaHref string, samlHref string, oktasession OktaSession) (st

func makeRequest(url string, body io.Reader) ([]byte, int, error) {
resp, err := http.Post(url, "application/json", body)
log.WithField("url", url).WithField("statusCode", resp.StatusCode).Debug("okta.go: Okta request")
if resp != nil {
log.WithField("url", url).WithField("statusCode", resp.StatusCode).Debug("okta.go: Okta request")
} else {
log.WithField("url", url).Debug("okta.go: Okta returned a nil response")
}

if err != nil {
return []byte{}, YAK_STATUS_NET_ERROR, err
Expand Down

0 comments on commit 58c0a0e

Please sign in to comment.