From a994f859e16abb892358534509c9737f6ed32516 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 16 Mar 2022 10:11:48 +0100 Subject: [PATCH] Fix crash when closing room during timeline decryption --- changelog.d/5552.bugfix | 1 + .../session/room/timeline/TimelineEventDecryptor.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog.d/5552.bugfix diff --git a/changelog.d/5552.bugfix b/changelog.d/5552.bugfix new file mode 100644 index 0000000000..5061e642f0 --- /dev/null +++ b/changelog.d/5552.bugfix @@ -0,0 +1 @@ +Fix crash when closing a room while decrypting timeline events diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineEventDecryptor.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineEventDecryptor.kt index bacac58d84..3ddd877b78 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineEventDecryptor.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineEventDecryptor.kt @@ -100,8 +100,12 @@ internal class TimelineEventDecryptor @Inject constructor( } executor?.execute { Realm.getInstance(realmConfiguration).use { realm -> - runBlocking { - processDecryptRequest(request, realm) + try { + runBlocking { + processDecryptRequest(request, realm) + } + } catch (e: InterruptedException) { + Timber.i("Decryption got interrupted") } } }