mirror of
https://github.com/HexCardGames/HexDeck.git
synced 2026-10-14 00:07:53 +02:00
fix(backend): check that player socket exists before trying to send data
This commit is contained in:
1 parent
49e84eaac7
commit
889ee4ce4f
2 files changed
+7
No files matched your search
@@ -141,6 +141,9 @@ func OnPlayerStateUpdate(room *types.Room, player *types.Player, skipDBUpdate bo
|
||||
if !skipDBUpdate {
|
||||
db.Conn.UpdateRoom(room)
|
||||
}
|
||||
if player.Connection.Socket == nil {
|
||||
return
|
||||
}
|
||||
player.Connection.Socket.Emit("OwnCards", types.BuildOwnCardsPacket(room, player))
|
||||
BroadcastInRoom(room, "PlayerState", types.BuildPlayerStatePacket(room, player))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user