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:
parent
a571996ff3
commit
aa061f8ef3
2 changed files with 16 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue