Fixed panic in socket cleanup (#1193)

This commit is contained in:
RoyUP9
2022-07-11 11:18:58 +03:00
committed by GitHub
parent 9aaf3f1423
commit 5875ba0eb3

View File

@@ -97,7 +97,9 @@ func websocketHandler(c *gin.Context, eventHandlers EventHandlers, isTapper bool
websocketIdsLock.Unlock()
defer func() {
socketCleanup(socketId, connectedWebsockets[socketId])
if socketConnection := connectedWebsockets[socketId]; socketConnection != nil {
socketCleanup(socketId, socketConnection)
}
}()
eventHandlers.WebSocketConnect(c, socketId, isTapper)