Skip to content

Commit adbb0df

Browse files
committed
fix bug
1 parent c7890ec commit adbb0df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ io.on('connection', (socket: socketIO.Socket) => {
8181
if (io.sockets.adapter.rooms[c]) {
8282
let socketsInLobby = Object.keys(io.sockets.adapter.rooms[c].sockets);
8383
for (let s of socketsInLobby) {
84-
if (clients.get(s).clientId === clientId) {
84+
if (clients.has(s) && clients.get(s).clientId === clientId) {
8585
socket.disconnect();
8686
logger.error(`Socket %s sent invalid join command, attempted spoofing another client`);
8787
return;

0 commit comments

Comments
 (0)