From a46d1ce3392038eee84014a28476e8b662183709 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 9 Oct 2025 12:06:58 +0200 Subject: [PATCH] Fix Detekt issue. --- .../matrix/impl/encryption/RustEncryptionService.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt index f380bbe532..91cafd1df0 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt @@ -207,11 +207,10 @@ class RustEncryptionService( runCatchingExceptions { service.recover(recoveryKey) }.recoverCatching { - if (it is RustRecoveryException.Import) { + when (it) { // We ignore import errors because the user will be notified about them via the "Key storage out of sync" detection. - Unit - } else { - throw it.mapRecoveryException() + is RustRecoveryException.Import -> Unit + else -> throw it.mapRecoveryException() } } }