Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 2c7e53d

Browse files
committed
fix panic on nil conn
1 parent 0fb044c commit 2c7e53d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gateway.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,9 @@ func (g *GatewayConnection) startWorkers() error {
922922
receivedAck: true,
923923
sequence: new(int64),
924924
onNoAck: func() {
925+
if g.conn == nil {
926+
return
927+
}
925928
g.log(LogError, "No heartbeat ack received since sending last heartbeast, reconnecting... ip: %s", g.conn.RemoteAddr().String())
926929
err := g.ReconnectUnlessClosed(false)
927930
if err != nil {

0 commit comments

Comments
 (0)