diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt index b1a9e50fd..5fc0aa2a2 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -1709,14 +1709,19 @@ class ChatController(args: Bundle) : binding.messageInputView.findViewById(R.id.attachmentButton)?.visibility = View.VISIBLE } + @Suppress("Detekt.TooGenericExceptionCaught") private fun cancelNotificationsForCurrentConversation() { if (conversationUser != null) { if (!TextUtils.isEmpty(roomToken)) { - NotificationUtils.cancelExistingNotificationsForRoom( - applicationContext, - conversationUser, - roomToken!! - ) + try { + NotificationUtils.cancelExistingNotificationsForRoom( + applicationContext, + conversationUser, + roomToken!! + ) + } catch (e: RuntimeException) { + Log.w(TAG, "Cancel notifications for current conversation results with an error.", e) + } } } }