fix exception that appears in logs if session ends before last call status update

This commit is contained in:
Dave Horton
2023-07-18 13:20:53 -04:00
parent d8543f73f2
commit 6793bbf330
3 changed files with 7 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ class WsRequestor extends BaseRequestor {
/* simple notifications */
if (['call:status', 'verb:status', 'jambonz:error'].includes(type) || reconnectingWithoutAck) {
this.ws.send(JSON.stringify(obj), () => {
this.ws?.send(JSON.stringify(obj), () => {
this.logger.debug({obj}, `WsRequestor:request websocket: sent (${url})`);
sendQueuedMsgs();
});