Fix: nil pointer dereference in IsConnected
This commit is contained in:
parent
ce2eeb8072
commit
79e2583dda
@ -525,6 +525,9 @@ func (c *Client) IsConnected() bool {
|
|||||||
if c.conn == nil {
|
if c.conn == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if c.conn.connected.Load() == nil {
|
||||||
|
c.conn.connected.Store(false)
|
||||||
|
}
|
||||||
|
|
||||||
return c.conn.connected.Load().(bool)
|
return c.conn.connected.Load().(bool)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user