Skip to content

Commit a180eaf

Browse files
committed
create a empty return check
1 parent c5a8b00 commit a180eaf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

request.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ func (r *Request) Execute(ctx context.Context, method string, url string, body i
204204
if err != nil {
205205
return errors.E(err, errParams)
206206
}
207+
if b == nil || len(b) == 0 {
208+
return nil
209+
}
207210
err = json.Unmarshal(b, result)
208211
if err != nil {
209212
return errors.E(err, errParams)

0 commit comments

Comments
 (0)