From 9b21b65478ab61c86e208e5542c1c57063a95c36 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 15 Feb 2023 20:29:47 -0500 Subject: [PATCH] fix uncaught exception in certain ws reconnect scenarios --- lib/utils/ws-requestor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/ws-requestor.js b/lib/utils/ws-requestor.js index 816599c7..d0f49d84 100644 --- a/lib/utils/ws-requestor.js +++ b/lib/utils/ws-requestor.js @@ -144,7 +144,7 @@ class WsRequestor extends BaseRequestor { return new Promise((resolve, reject) => { /* give the far end a reasonable amount of time to ack our message */ const timer = setTimeout(() => { - const {failure} = this.messagesInFlight.get(msgid); + const {failure} = this.messagesInFlight.get(msgid) || {}; failure && failure(`timeout from far end for msgid ${msgid}`); this.messagesInFlight.delete(msgid); }, RESPONSE_TIMEOUT_MS);