]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix crash quitting when accept conn is closed
authorMatt Joiner <anacrolix@gmail.com>
Thu, 3 Jul 2014 15:44:15 +0000 (01:44 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 3 Jul 2014 15:44:15 +0000 (01:44 +1000)
client.go

index 349914d5923bef26d6fe9d386061b7d08d272536..7ab5ca6ab8e6141acc479912a56aa11ca7df967f 100644 (file)
--- 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:
                }