Fix null pointer derefernce in validateColor
This commit is contained in:
parent
2107a05864
commit
41b730d33d
7
color.go
7
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user