diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-09-15 18:58:06 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-09-15 18:59:25 +0200 |
commit | b451c726d5f144d9a42224c457cc175d4fc8c093 (patch) | |
tree | d0610d0d56b28ca603de8011919738117e01a708 | |
parent | e94ef87d23f1ea8ffe74390e95f6dedad1fc515d (diff) | |
download | server-b451c726d5f144d9a42224c457cc175d4fc8c093.tar.gz |
Fix crash when updating unread chats if anonymous observers are present.
-rw-r--r-- | server.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2369,7 +2369,7 @@ function on_chat(socket, message) { for (let user_id of users) { let found = false for (let other of game_clients[socket.game_id]) - if (other.user.user_id === user_id) + if (other.user && other.user.user_id === user_id && other.role !== "Observer") found = true if (!found) SQL_INSERT_UNREAD_CHAT.run(user_id, socket.game_id) |