From 1ffed1c220fb48654b8d343924efbd05aabdf5e1 Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Fri, 2 Apr 2021 21:47:26 +0530 Subject: [PATCH] part 2 --- src/ws/handler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ws/handler.js b/src/ws/handler.js index 7971ac2..72fadf5 100644 --- a/src/ws/handler.js +++ b/src/ws/handler.js @@ -38,7 +38,11 @@ const handleMsg = async (msg, id) => { dm.event = 'streams:full' dm.data = await crud[channel].getAllPop() } - connections[id]?.connection?.send(JSON.stringify(dm)) + try { + connections[id].connection.send(JSON.stringify(dm)) + } catch (e) { + console.warn(e) + } } else if (d.hasOwnProperty('event') && channelEvents.indexOf(d.event) !== -1) { const ev = d.event.split(':') const channel = ev[0]