mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-09-26 20:21:12 +08:00
Protect close of nil outbound channel
This commit is contained in:
@@ -364,7 +364,9 @@ func (cl *Client) Stop(err error) {
|
||||
cl.State.stopCause.Store(err)
|
||||
}
|
||||
|
||||
close(cl.State.outbound)
|
||||
if cl.State.outbound != nil {
|
||||
close(cl.State.outbound)
|
||||
}
|
||||
|
||||
atomic.StoreUint32(&cl.State.done, 1)
|
||||
atomic.StoreInt64(&cl.State.disconnected, time.Now().Unix())
|
||||
|
Reference in New Issue
Block a user