From ae45175015f9e13402960d21a22241371ab55d92 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 4 Jul 2014 01:44:15 +1000 Subject: [PATCH] Fix crash quitting when accept conn is closed --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 349914d5..7ab5ca6a 100644 --- a/client.go +++ b/client.go @@ -225,7 +225,9 @@ func (cl *Client) acceptConnections() { conn, err := cl.Listener.Accept() select { case <-cl.quit: - conn.Close() + if conn != nil { + conn.Close() + } return default: }