From ad656224077c68b997c7839e2f19ca594991bdba Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Fri, 8 Sep 2023 00:45:00 +0300 Subject: [PATCH] desktop: catch Toast exception (#3028) --- .../kotlin/chat/simplex/common/model/NtfManager.desktop.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/model/NtfManager.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/model/NtfManager.desktop.kt index 486b147f8..94e985328 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/model/NtfManager.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/model/NtfManager.desktop.kt @@ -104,7 +104,11 @@ object NtfManager { actions.forEach { builder.action(it.first, it.second) } - prevNtfs.add(chatId to builder.toast()) + try { + prevNtfs.add(chatId to builder.toast()) + } catch (e: Exception) { + Log.e(TAG, e.stackTraceToString()) + } } private fun prepareIconPath(icon: ImageBitmap?): String? = if (icon != null) {