From 82aefb98634d4c6b91d80247c7adbdd3c2580a01 Mon Sep 17 00:00:00 2001 From: Oussama Hassine Date: Mon, 15 May 2023 12:40:08 +0200 Subject: [PATCH] fix: server config crash (RC) (#1786) * fix: serverConfig crash * chore: cleanup --- .../notification/WireNotificationManager.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/notification/WireNotificationManager.kt b/app/src/main/kotlin/com/wire/android/notification/WireNotificationManager.kt index 0c992e48545..a031135849e 100644 --- a/app/src/main/kotlin/com/wire/android/notification/WireNotificationManager.kt +++ b/app/src/main/kotlin/com/wire/android/notification/WireNotificationManager.kt @@ -375,13 +375,17 @@ class WireNotificationManager @Inject constructor( if (currentScreen !is CurrentScreen.InBackground) { flowOf(null) } else { - coreLogic.getSessionScope(userId).calls - .establishedCall() - .map { - it.firstOrNull()?.let { call -> - OngoingCallData(callNotificationManager.getNotificationTitle(call), call.conversationId, userId) + try { + coreLogic.getSessionScope(userId).calls + .establishedCall() + .map { + it.firstOrNull()?.let { call -> + OngoingCallData(callNotificationManager.getNotificationTitle(call), call.conversationId, userId) + } } - } + } catch (e: IllegalStateException) { + flowOf(null) + } } } .distinctUntilChanged()