Skip to content

Commit

Permalink
create a empty return check
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Apr 17, 2021
1 parent c5a8b00 commit a180eaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ func (r *Request) Execute(ctx context.Context, method string, url string, body i
if err != nil {
return errors.E(err, errParams)
}
if b == nil || len(b) == 0 {
return nil
}
err = json.Unmarshal(b, result)
if err != nil {
return errors.E(err, errParams)
Expand Down

0 comments on commit a180eaf

Please sign in to comment.