From d799fa3b5af57f3c1bda77fcee8b1acfd532d733 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 18 Nov 2025 17:16:07 +0100 Subject: [PATCH] Fix reported crash. https://github.com/element-hq/element-x-android-rageshakes/issues/8517 --- .../edit/EditDefaultNotificationSettingPresenter.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingPresenter.kt index bb6cb823d2..3d2356cb94 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingPresenter.kt @@ -138,7 +138,12 @@ class EditDefaultNotificationSettingPresenter( ) } // locale sensitive sorting - .sortedWith(compareBy(Collator.getInstance()) { roomSummary -> roomSummary.name }) + .sortedWith( + compareBy(Collator.getInstance()) { roomSummary -> + // Collator does not handle null values, so we provide a fallback + roomSummary.name ?: roomSummary.roomId.value + } + ) } private fun CoroutineScope.setDefaultNotificationMode(mode: RoomNotificationMode, action: MutableState>) = launch {