Skip to content

Commit

Permalink
fix: if no sockets[i] continue
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Dec 18, 2023
1 parent a3f5a7e commit fcab2cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit fcab2cc

Please sign in to comment.