Skip to content

Commit

Permalink
check for err before request response field access (#169)
Browse files Browse the repository at this point in the history
Co-authored-by: Rostislav Lyupa <>
  • Loading branch information
lyro41 authored Mar 17, 2024
1 parent 35957be commit bf6bfc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func (c *Client) Request(req *http.Request, dst interface{}) (err error) {
c.debugf("request: %v", req)
resp, err := c.httpClient.Do(req)
c.debugf("response: %v", resp)
c.debugf("response status code: %v", resp.StatusCode)
if err != nil {
return err
}
c.debugf("response status code: %v", resp.StatusCode)
defer func() {
cerr := resp.Body.Close()
if err == nil && cerr != nil {
Expand Down

0 comments on commit bf6bfc3

Please sign in to comment.