fix: fixing client nil pointer

This commit is contained in:
2025-09-26 16:10:19 +07:00
parent 034e5b68e0
commit e686e69a24

View File

@@ -189,7 +189,10 @@ func (wsClient *SafeWebsocketClient) connect() error {
})
wsClient.mu.WriteHandler(func() error {
wsClient.conn.Close()
if wsClient.conn != nil {
wsClient.conn.Close()
}
ctx, cancel := context.WithCancel(context.Background())
wsClient.ctx = ctx
wsClient.cancel = cancel