Skip to content

Commit

Permalink
fix(hass): handle empty config response
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Jun 3, 2023
1 parent 4d22c2f commit f4b4412
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/hass/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func (h *HassConfig) RequestData() *json.RawMessage {
}

func (h *HassConfig) ResponseHandler(resp bytes.Buffer) {
if resp.Bytes() == nil {
log.Debug().
Msg("No response returned.")
return
}
h.mu.Lock()
result, err := marshmallow.Unmarshal(resp.Bytes(), &h.hassConfigProps)
if err != nil {
Expand Down

0 comments on commit f4b4412

Please sign in to comment.