diff --git a/.changeset/red-maps-happen.md b/.changeset/red-maps-happen.md new file mode 100644 index 0000000000..a21108df2a --- /dev/null +++ b/.changeset/red-maps-happen.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Prevent undefined access to engine in connection reconciler diff --git a/src/room/Room.ts b/src/room/Room.ts index 6319d1768d..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();