summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.js b/server.js
index c3487e1..c07b0d8 100644
--- a/server.js
+++ b/server.js
@@ -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)