Skip to content

Commit

Permalink
Fix panic on reconnect
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Stokking <johan@stokking.nl>
  • Loading branch information
johanstokking committed Sep 17, 2020
1 parent ca94c53 commit d5205fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Expand Up @@ -318,7 +318,9 @@ func (c *client) reconnect() {

// Disconnect() must have been called while we were trying to reconnect.
if c.connectionStatus() == disconnected {
conn.Close()
if conn != nil {
conn.Close()
}
DEBUG.Println(CLI, "Client moved to disconnected state while reconnecting, abandoning reconnect")
return
}
Expand Down

0 comments on commit d5205fe

Please sign in to comment.