From 4a2e31f16d627511f6a45c78dca80802f0541a82 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 1 Apr 2020 10:35:46 +0200 Subject: [PATCH] Prevent Service crash --- app/src/main/java/org/linphone/core/CoreService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/linphone/core/CoreService.kt b/app/src/main/java/org/linphone/core/CoreService.kt index 94c16eb5d..01eb25f57 100644 --- a/app/src/main/java/org/linphone/core/CoreService.kt +++ b/app/src/main/java/org/linphone/core/CoreService.kt @@ -32,8 +32,8 @@ class CoreService : CoreService() { Log.i("[Service] Created") } - override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { - if (intent.extras?.get("StartForeground") == true) { + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + if (intent?.extras?.get("StartForeground") == true) { Log.i("[Service] Starting as foreground") coreContext.notificationsManager.startForeground(this, true) }