fix uncaught exception in certain ws reconnect scenarios

This commit is contained in:
Dave Horton
2023-02-15 20:29:47 -05:00
parent c09425fa89
commit 9b21b65478

View File

@@ -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);