Skip to content

Commit

Permalink
Merge pull request #451 from johanstokking/master
Browse files Browse the repository at this point in the history
Fix panic on reconnect
  • Loading branch information
Al S-M committed Sep 18, 2020
2 parents 4b393de + cf2daad commit 5feda7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Expand Up @@ -316,7 +316,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 5feda7b

Please sign in to comment.