From fcab2ccbf5ea6199ac2e2ceb111aa1fa6f23cf28 Mon Sep 17 00:00:00 2001 From: frankpagan Date: Mon, 18 Dec 2023 07:40:30 -0600 Subject: [PATCH] fix: if no sockets[i] continue --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index c823fd9..7382962 100644 --- a/src/index.js +++ b/src/index.js @@ -461,6 +461,9 @@ class SocketServer extends EventEmitter { delete data.socket for (let i = 0; i < sockets.length; i++) { + if (!sockets[i]) + continue + const authorized = await this.authorize.check(data, sockets[i].user_id) if (authorized && authorized.authorized) sockets[i].send(JSON.stringify(authorized.authorized));