File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " livekit-client " : patch
3+ ---
4+
5+ Fix potential undefined access while disconnecting
Original file line number Diff line number Diff line change @@ -967,12 +967,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
967967 ) ;
968968 this . connectFuture = undefined ;
969969 }
970- // send leave
971- if ( ! this . engine ?. client . isDisconnected ) {
972- await this . engine . client . sendLeave ( ) ;
973- }
970+
974971 // close engine (also closes client)
975972 if ( this . engine ) {
973+ // send leave
974+ if ( ! this . engine . client . isDisconnected ) {
975+ await this . engine . client . sendLeave ( ) ;
976+ }
976977 await this . engine . close ( ) ;
977978 }
978979 this . handleDisconnect ( stopTracks , DisconnectReason . CLIENT_INITIATED ) ;
You can’t perform that action at this time.
0 commit comments