Skip to content

Commit d626660

Browse files
authored
Fix crash in the room list after a forced log out in background (#3180)
1 parent 544b4a1 commit d626660

File tree

1 file changed

+4
-6
lines changed
  • libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist

1 file changed

+4
-6
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist/RoomListExtensions.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import kotlinx.coroutines.flow.onEach
3131
import org.matrix.rustcomponents.sdk.RoomListEntriesDynamicFilterKind
3232
import org.matrix.rustcomponents.sdk.RoomListEntriesListener
3333
import org.matrix.rustcomponents.sdk.RoomListEntriesUpdate
34-
import org.matrix.rustcomponents.sdk.RoomListException
3534
import org.matrix.rustcomponents.sdk.RoomListInterface
3635
import org.matrix.rustcomponents.sdk.RoomListItem
3736
import org.matrix.rustcomponents.sdk.RoomListLoadingState
@@ -128,11 +127,10 @@ internal fun RoomListServiceInterface.syncIndicator(): Flow<RoomListServiceSyncI
128127
}
129128
}.buffer(Channel.UNLIMITED)
130129

131-
internal suspend fun RoomListServiceInterface.roomOrNull(roomId: String): RoomListItem? {
132-
return try {
130+
internal fun RoomListServiceInterface.roomOrNull(roomId: String): RoomListItem? {
131+
return tryOrNull(
132+
onError = { Timber.e(it, "Failed finding room with id=$roomId.") }
133+
) {
133134
room(roomId)
134-
} catch (exception: RoomListException) {
135-
Timber.d(exception, "Failed finding room with id=$roomId.")
136-
return null
137135
}
138136
}

0 commit comments

Comments
 (0)