From 6a9b6312ceb8ef1f17097be0bed16a66d51f1e8b Mon Sep 17 00:00:00 2001 From: Elin Angelow Date: Sat, 3 Feb 2024 20:54:25 +0200 Subject: [PATCH] fix: dont try to send msg over dead conn --- lib/wss.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/wss.js b/lib/wss.js index d5b3a5a..2701d48 100644 --- a/lib/wss.js +++ b/lib/wss.js @@ -92,6 +92,9 @@ const Wss = ({ } return; } + if (!this.connection(message.params.connectionId)) { + throw new Error('noTargetConnectionFound'); + } // request, it will wait for response, and send data back // here we are creating response matcher also const rq = this.requestAdd(message.params.connectionId, message);