diff --git a/server/src/socketRegistry.js b/server/src/socketRegistry.js index 31d26cb5..79f1bdca 100644 --- a/server/src/socketRegistry.js +++ b/server/src/socketRegistry.js @@ -41,6 +41,10 @@ export default function socketRegistryFactory() { } function removeSocketMapping(socketId, userId, roomId) { + if (!registry[socketId]) { + return; + } + LOGGER.debug(`Removing mapping: socket ${socketId} -> [user ${userId}, room ${roomId}]`); if (registry[socketId].userId !== userId) {