We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7f825b commit e8d0e19Copy full SHA for e8d0e19
1 file changed
server.js
@@ -140,7 +140,7 @@ wss.on("connection", function connection(ws) {
140
if (isValid) {
141
if (isHost) { //If message sender is a host
142
connections[roomColumn].forEach(function each(client) {
143
- if (client.readyState === WebSocket.OPEN) {
+ if (client && client.readyState === WebSocket.OPEN) {
144
client.send(nickName + ":" + message.toString());
145
// console.log("Sending Message");
146
}
@@ -237,4 +237,4 @@ function deleteClients(clientArray) {
237
// client.close();
238
delete client;
239
});
240
-}
+}
0 commit comments