Prevent crash if NotificationManager throws an exception
This commit is contained in:
parent
d14a62730a
commit
8397debb00
1 changed files with 5 additions and 1 deletions
|
@ -317,7 +317,11 @@ class NotificationsManager(private val context: Context) {
|
|||
}
|
||||
|
||||
Log.i("[Notifications Manager] Notifying [$id] with tag [$tag]")
|
||||
notificationManager.notify(tag, id, notification)
|
||||
try {
|
||||
notificationManager.notify(tag, id, notification)
|
||||
} catch (iae: IllegalArgumentException) {
|
||||
Log.e("[Notifications Manager] Exception occurred: $iae")
|
||||
}
|
||||
}
|
||||
|
||||
fun cancel(id: Int, tag: String? = null) {
|
||||
|
|
Loading…
Reference in a new issue