Fix after #614 fix

This commit is contained in:
Alexey Khit
2023-09-10 16:03:49 +03:00
parent 398afbe49f
commit 8f98fc4547
+2 -6
View File
@@ -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()
}