From 61cd821d81402bd128ff70c25feb7d74709bc7af Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 9 Dec 2024 17:57:57 +0100 Subject: [PATCH] set engine undefined if it's undefined2 --- src/room/Room.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/room/Room.ts b/src/room/Room.ts index 33e8978923..effcb84a64 100644 --- a/src/room/Room.ts +++ b/src/room/Room.ts @@ -1903,10 +1903,12 @@ class Room extends (EventEmitter as new () => TypedEmitter) this.log.warn('detected connection state mismatch', { ...this.logContext, numFailures: consecutiveFailures, - engine: { - closed: !!this.engine?.isClosed, - transportsConnected: !!this.engine?.verifyTransport(), - }, + engine: this.engine + ? { + closed: this.engine.isClosed, + transportsConnected: this.engine.verifyTransport(), + } + : undefined, }); if (consecutiveFailures >= 3) { this.recreateEngine();