mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
Fix unhandled crashes when network is not reacheable.
This commit is contained in:
parent
2a5df54ae4
commit
8433e222ad
2 changed files with 6 additions and 2 deletions
|
@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.session.sync.handler
|
|||
import androidx.work.BackoffPolicy
|
||||
import androidx.work.ExistingWorkPolicy
|
||||
import org.matrix.android.sdk.api.MatrixPatterns
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.internal.crypto.crosssigning.UpdateTrustWorker
|
||||
import org.matrix.android.sdk.internal.crypto.crosssigning.UpdateTrustWorkerDataRepository
|
||||
import org.matrix.android.sdk.internal.di.SessionId
|
||||
|
@ -81,7 +82,9 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
|
|||
}
|
||||
}
|
||||
if (hasUpdate) {
|
||||
updateUserAccountDataTask.execute(UpdateUserAccountDataTask.DirectChatParams(directMessages = directChats))
|
||||
tryOrNull("Unable to update user account data") {
|
||||
updateUserAccountDataTask.execute(UpdateUserAccountDataTask.DirectChatParams(directMessages = directChats))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.zhuinden.monarchy.Monarchy
|
|||
import io.realm.Realm
|
||||
import io.realm.RealmList
|
||||
import io.realm.kotlin.where
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.failure.GlobalError
|
||||
import org.matrix.android.sdk.api.failure.InitialSyncRequestReason
|
||||
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
|
||||
|
@ -122,7 +123,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
|
|||
val updateUserAccountParams = UpdateUserAccountDataTask.DirectChatParams(
|
||||
directMessages = directChats
|
||||
)
|
||||
updateUserAccountDataTask.execute(updateUserAccountParams)
|
||||
tryOrNull("Unable to update user account data") { updateUserAccountDataTask.execute(updateUserAccountParams) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue