From 8f98fc454771df31985909b4a951f82d8332ece8 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Sun, 10 Sep 2023 16:03:49 +0300 Subject: [PATCH] Fix after #614 fix --- pkg/hap/client.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/hap/client.go b/pkg/hap/client.go index 3b882588..6d9ad37b 100644 --- a/pkg/hap/client.go +++ b/pkg/hap/client.go @@ -317,14 +317,10 @@ func (c *Client) GetImage(width, height int) ([]byte, error) { } func (c *Client) LocalIP() string { - conn, ok := c.Conn.(*net.TCPConn) - if !ok { - return "" - } - addr, ok := conn.LocalAddr().(*net.TCPAddr) - if !ok { + if c.Conn == nil { return "" } + addr := c.Conn.LocalAddr().(*net.TCPAddr) return addr.IP.String() }