Fix crash when calling Room.predecessorRoom when the room is destroyed (#5894)
* Fix crash when calling `Client.predecessorRoom` when the room is destroyed * Handle the root cause of this crash: destroying the room on activity recreation
This commit is contained in:
committed by
GitHub
parent
a571996ff3
commit
aa061f8ef3
+3
-1
@@ -85,7 +85,9 @@ class RustBaseRoom(
|
||||
}.stateIn(roomCoroutineScope, started = SharingStarted.Lazily, initialValue = initialRoomInfo)
|
||||
|
||||
override fun predecessorRoom(): PredecessorRoom? {
|
||||
return innerRoom.predecessorRoom()?.map()
|
||||
return runCatchingExceptions { innerRoom.predecessorRoom()?.map() }
|
||||
.onFailure { Timber.e(it, "Could not get predecessor room") }
|
||||
.getOrNull()
|
||||
}
|
||||
|
||||
override suspend fun subscribeToSync() = roomSyncSubscriber.subscribe(roomId)
|
||||
|
||||
Reference in New Issue
Block a user