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