Prevent runtime exception if we failed to build service notification
This commit is contained in:
parent
4226dd6d5c
commit
a0d0bb0d48
1 changed files with 4 additions and 0 deletions
|
@ -327,6 +327,10 @@ class NotificationsManager(private val context: Context) {
|
|||
fun startForeground(coreService: CoreService, useAutoStartDescription: Boolean = true) {
|
||||
if (serviceNotification == null) {
|
||||
createServiceNotification(useAutoStartDescription)
|
||||
if (serviceNotification == null) {
|
||||
Log.e("[Notifications Manager] Failed to create service notification, aborting foreground service!")
|
||||
return
|
||||
}
|
||||
}
|
||||
currentForegroundServiceNotificationId = SERVICE_NOTIF_ID
|
||||
Log.i("[Notifications Manager] Starting service as foreground [$currentForegroundServiceNotificationId]")
|
||||
|
|
Loading…
Reference in a new issue