mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Fix crash in the room list after a forced log out in background (#3180)
This commit is contained in:
committed by
GitHub
parent
544b4a1057
commit
d626660023
+4
-6
@@ -31,7 +31,6 @@ import kotlinx.coroutines.flow.onEach
|
|||||||
import org.matrix.rustcomponents.sdk.RoomListEntriesDynamicFilterKind
|
import org.matrix.rustcomponents.sdk.RoomListEntriesDynamicFilterKind
|
||||||
import org.matrix.rustcomponents.sdk.RoomListEntriesListener
|
import org.matrix.rustcomponents.sdk.RoomListEntriesListener
|
||||||
import org.matrix.rustcomponents.sdk.RoomListEntriesUpdate
|
import org.matrix.rustcomponents.sdk.RoomListEntriesUpdate
|
||||||
import org.matrix.rustcomponents.sdk.RoomListException
|
|
||||||
import org.matrix.rustcomponents.sdk.RoomListInterface
|
import org.matrix.rustcomponents.sdk.RoomListInterface
|
||||||
import org.matrix.rustcomponents.sdk.RoomListItem
|
import org.matrix.rustcomponents.sdk.RoomListItem
|
||||||
import org.matrix.rustcomponents.sdk.RoomListLoadingState
|
import org.matrix.rustcomponents.sdk.RoomListLoadingState
|
||||||
@@ -128,11 +127,10 @@ internal fun RoomListServiceInterface.syncIndicator(): Flow<RoomListServiceSyncI
|
|||||||
}
|
}
|
||||||
}.buffer(Channel.UNLIMITED)
|
}.buffer(Channel.UNLIMITED)
|
||||||
|
|
||||||
internal suspend fun RoomListServiceInterface.roomOrNull(roomId: String): RoomListItem? {
|
internal fun RoomListServiceInterface.roomOrNull(roomId: String): RoomListItem? {
|
||||||
return try {
|
return tryOrNull(
|
||||||
|
onError = { Timber.e(it, "Failed finding room with id=$roomId.") }
|
||||||
|
) {
|
||||||
room(roomId)
|
room(roomId)
|
||||||
} catch (exception: RoomListException) {
|
|
||||||
Timber.d(exception, "Failed finding room with id=$roomId.")
|
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user