diff --git a/client.go b/client.go index b7795205..35ec06f2 100644 --- a/client.go +++ b/client.go @@ -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 }