Fixed crash reported on Crashlytics
This commit is contained in:
parent
bf1f2c3175
commit
7f122c7ab8
2 changed files with 9 additions and 2 deletions
|
@ -88,6 +88,10 @@ class LinphoneApplication : Application(), ImageLoaderFactory {
|
|||
coreContext.start()
|
||||
return true
|
||||
}
|
||||
|
||||
fun contextExists(): Boolean {
|
||||
return ::coreContext.isInitialized
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.linphone.core
|
||||
|
||||
import android.content.Intent
|
||||
import org.linphone.LinphoneApplication
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.LinphoneApplication.Companion.ensureCoreExists
|
||||
|
@ -80,8 +81,10 @@ class CoreService : CoreService() {
|
|||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
Log.i("[Service] Stopping")
|
||||
coreContext.notificationsManager.serviceDestroyed()
|
||||
if (LinphoneApplication.contextExists()) {
|
||||
Log.i("[Service] Stopping")
|
||||
coreContext.notificationsManager.serviceDestroyed()
|
||||
}
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue