Compare commits

..

No commits in common. "f79ea1df5d908f8473798b81bd4cddd455f0e8e8" and "2107a0586447e3e102667d5895d8c12827be5ebc" have entirely different histories.

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
)
@ -200,6 +201,7 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
var (
err error
s *HSBKColor
r *http.Response
resp *Response
)
@ -207,12 +209,13 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
return nil, err
}
defer resp.Body.Close()
if resp.IsError() {
return nil, resp.GetLifxError()
resp, err = NewResponse(r)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if err = json.NewDecoder(resp.Body).Decode(&s); err != nil {
return nil, err
}