mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-24 14:05:40 +03:00
Catch RuntimeException thrown by NotificationManager
In case anything goes wront during calling 'NotificationManger#activeNotification' an 'RuntimeException' will be thrown. This results in a crash if not catched. Resolves: #2078 Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
7a3e81073e
commit
964dc2a76d
1 changed files with 10 additions and 5 deletions
|
@ -1709,14 +1709,19 @@ class ChatController(args: Bundle) :
|
|||
binding.messageInputView.findViewById<ImageButton>(R.id.attachmentButton)?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
private fun cancelNotificationsForCurrentConversation() {
|
||||
if (conversationUser != null) {
|
||||
if (!TextUtils.isEmpty(roomToken)) {
|
||||
try {
|
||||
NotificationUtils.cancelExistingNotificationsForRoom(
|
||||
applicationContext,
|
||||
conversationUser,
|
||||
roomToken!!
|
||||
)
|
||||
} catch (e: RuntimeException) {
|
||||
Log.w(TAG, "Cancel notifications for current conversation results with an error.", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue