From 158bd27e250c83c6103c02697495605ada199c5f Mon Sep 17 00:00:00 2001 From: Reverite Date: Wed, 8 May 2019 13:29:31 -0700 Subject: [PATCH] Check for resBody != nil on JSON decode --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 3b278d5..fc290ed 100644 --- a/client.go +++ b/client.go @@ -241,7 +241,7 @@ func (cli *Client) MakeRequest(method string, httpURL string, reqBody interface{ } } - if res.Body != nil { + if resBody != nil && res.Body != nil { return json.NewDecoder(res.Body).Decode(&resBody) }