From de040fb16054cb7f7bc5c5b3d6d7446b7696b7c7 Mon Sep 17 00:00:00 2001 From: Alex X Date: Wed, 11 Oct 2023 14:34:01 +0300 Subject: [PATCH] Fix panic for homekit source (nil conn) #628 --- pkg/hap/client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/hap/client.go b/pkg/hap/client.go index 8ce8c472..de038b67 100644 --- a/pkg/hap/client.go +++ b/pkg/hap/client.go @@ -228,9 +228,7 @@ func (c *Client) Close() error { if c.Conn == nil { return nil } - conn := c.Conn - c.Conn = nil - return conn.Close() + return c.Conn.Close() } func (c *Client) eventsReader() {