Check if conn is nil before closing
This commit is contained in:
parent
81500cc89e
commit
6f9f3cff95
|
@ -84,7 +84,9 @@ func (c *Client) Quit() {
|
||||||
}
|
}
|
||||||
close(c.quit)
|
close(c.quit)
|
||||||
c.lock.Lock()
|
c.lock.Lock()
|
||||||
c.conn.Close()
|
if c.conn != nil {
|
||||||
|
c.conn.Close()
|
||||||
|
}
|
||||||
c.lock.Unlock()
|
c.lock.Unlock()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue