diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index 7be2c78b2..4df57605a 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -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]")