We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7890ec commit adbb0dfCopy full SHA for adbb0df
1 file changed
src/index.ts
@@ -81,7 +81,7 @@ io.on('connection', (socket: socketIO.Socket) => {
81
if (io.sockets.adapter.rooms[c]) {
82
let socketsInLobby = Object.keys(io.sockets.adapter.rooms[c].sockets);
83
for (let s of socketsInLobby) {
84
- if (clients.get(s).clientId === clientId) {
+ if (clients.has(s) && clients.get(s).clientId === clientId) {
85
socket.disconnect();
86
logger.error(`Socket %s sent invalid join command, attempted spoofing another client`);
87
return;
0 commit comments