From 6f9f3cff9515b82e968c04e1f7164e0913539eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Tue, 12 Jan 2016 22:03:49 +0100 Subject: [PATCH] Check if conn is nil before closing --- irc/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index 7d9cecef..2ab2953a 100644 --- a/irc/client.go +++ b/irc/client.go @@ -84,7 +84,9 @@ func (c *Client) Quit() { } close(c.quit) c.lock.Lock() - c.conn.Close() + if c.conn != nil { + c.conn.Close() + } c.lock.Unlock() }() }