Skip to content

Commit e8d0e19

Browse files
authored
Update server.js
1 parent e7f825b commit e8d0e19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ wss.on("connection", function connection(ws) {
140140
if (isValid) {
141141
if (isHost) { //If message sender is a host
142142
connections[roomColumn].forEach(function each(client) {
143-
if (client.readyState === WebSocket.OPEN) {
143+
if (client && client.readyState === WebSocket.OPEN) {
144144
client.send(nickName + ":" + message.toString());
145145
// console.log("Sending Message");
146146
}
@@ -237,4 +237,4 @@ function deleteClients(clientArray) {
237237
// client.close();
238238
delete client;
239239
});
240-
}
240+
}

0 commit comments

Comments
 (0)