Skip to content

Commit

Permalink
Ensure body is NPE safe
Browse files Browse the repository at this point in the history
  • Loading branch information
voiski authored and ldelossa committed Sep 7, 2020
1 parent b572037 commit 42e5d23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jiracmd/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func CmdRequest(o *oreo.Client, globals *jiracli.GlobalOptions, opts *RequestOpt
if err != nil {
return err
}
if resp.Body == nil {
return fmt.Errorf("Empty Response Body")
}
defer resp.Body.Close()

bodyBytes, err := ioutil.ReadAll(resp.Body)
Expand Down

0 comments on commit 42e5d23

Please sign in to comment.