From 41b730d33dcaf5c6f07e7d4d43e76905193ebad2 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 18 Apr 2021 15:41:14 +0000 Subject: [PATCH] Fix null pointer derefernce in validateColor --- color.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/color.go b/color.go index 7028677..09f65c7 100644 --- a/color.go +++ b/color.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "net/http" "strings" ) @@ -201,7 +200,6 @@ func (c *Client) ValidateColor(color Color) (Color, error) { var ( err error s *HSBKColor - r *http.Response resp *Response ) @@ -209,11 +207,6 @@ func (c *Client) ValidateColor(color Color) (Color, error) { return nil, err } - resp, err = NewResponse(r) - if err != nil { - return nil, err - } - defer resp.Body.Close() if err = json.NewDecoder(resp.Body).Decode(&s); err != nil {