mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 15:26:15 +00:00
Add some missing runCatching to protect innerRoom access.
May fix https://sentry.tools.element.io/organizations/element/issues/533226/events/e22d3a80ab204ce392e65c989c2753ac/
This commit is contained in:
+13
-5
@@ -105,8 +105,12 @@ class RustMatrixRoom(
|
|||||||
|
|
||||||
override val roomInfoFlow: Flow<MatrixRoomInfo> = mxCallbackFlow {
|
override val roomInfoFlow: Flow<MatrixRoomInfo> = mxCallbackFlow {
|
||||||
launch {
|
launch {
|
||||||
val initial = innerRoom.roomInfo().let(matrixRoomInfoMapper::map)
|
runCatching { innerRoom.roomInfo() }
|
||||||
channel.trySend(initial)
|
.getOrNull()
|
||||||
|
?.let(matrixRoomInfoMapper::map)
|
||||||
|
?.let { initial ->
|
||||||
|
channel.trySend(initial)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
innerRoom.subscribeToRoomInfoUpdates(object : RoomInfoListener {
|
innerRoom.subscribeToRoomInfoUpdates(object : RoomInfoListener {
|
||||||
override fun call(roomInfo: RoomInfo) {
|
override fun call(roomInfo: RoomInfo) {
|
||||||
@@ -623,9 +627,13 @@ class RustMatrixRoom(
|
|||||||
innerRoom.sendCallNotificationIfNeeded()
|
innerRoom.sendCallNotificationIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun setSendQueueEnabled(enabled: Boolean) = withContext(roomDispatcher) {
|
override suspend fun setSendQueueEnabled(enabled: Boolean) {
|
||||||
Timber.d("setSendQueuesEnabled: $enabled")
|
withContext(roomDispatcher) {
|
||||||
innerRoom.enableSendQueue(enabled)
|
Timber.d("setSendQueuesEnabled: $enabled")
|
||||||
|
runCatching {
|
||||||
|
innerRoom.enableSendQueue(enabled)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun saveComposerDraft(composerDraft: ComposerDraft): Result<Unit> = runCatching {
|
override suspend fun saveComposerDraft(composerDraft: ComposerDraft): Result<Unit> = runCatching {
|
||||||
|
|||||||
Reference in New Issue
Block a user