mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Merge pull request #2100 from nextcloud/bugfix/2078/RuntimeException-for-cancelExistingNotificationsForRoom
Catch RuntimeException thrown by NotificationManager
This commit is contained in:
commit
10753d039e
@ -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 New Issue
Block a user