adding catch around the push event dispatching to match previous behaviour

This commit is contained in:
Adam Brown 2021-11-03 15:07:44 +00:00
parent 57037c9ac6
commit 037d1fcf52

View file

@ -41,6 +41,7 @@ import org.matrix.android.sdk.internal.session.pushers.UpdatePushRuleActionsTask
import org.matrix.android.sdk.internal.session.pushers.UpdatePushRuleEnableStatusTask
import org.matrix.android.sdk.internal.task.TaskExecutor
import org.matrix.android.sdk.internal.task.configureWith
import timber.log.Timber
import javax.inject.Inject
@SessionScope
@ -160,7 +161,11 @@ internal class DefaultPushRuleService @Inject constructor(
fun dispatchEvents(pushEvents: PushEvents) {
synchronized(listeners) {
listeners.forEach {
it.onEvents(pushEvents)
try {
it.onEvents(pushEvents)
} catch (e: Throwable) {
Timber.e(e, "Error while dispatching push events")
}
}
}
}