for some reason we can encounter ws that have no users
This commit is contained in:
parent
fbc564f588
commit
1ffd8b740c
|
@ -142,7 +142,7 @@ class SocketServer {
|
||||||
) => {
|
) => {
|
||||||
const text = JSON.stringify([name, message, country, channelId, id]);
|
const text = JSON.stringify([name, message, country, channelId, id]);
|
||||||
this.wss.clients.forEach((ws) => {
|
this.wss.clients.forEach((ws) => {
|
||||||
if (ws.readyState === WebSocket.OPEN) {
|
if (ws.readyState === WebSocket.OPEN && ws.user) {
|
||||||
if (chatProvider.userHasChannelAccess(ws.user, channelId)) {
|
if (chatProvider.userHasChannelAccess(ws.user, channelId)) {
|
||||||
ws.send(text);
|
ws.send(text);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user