Fix crash quitting when accept conn is closed

This commit is contained in:
Matt Joiner 2014-07-04 01:44:15 +10:00
parent 78fe1b11ae
commit ae45175015
1 changed files with 3 additions and 1 deletions

View File

@ -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:
}