NSCv3: catch stop service crash
This commit is contained in:
parent
90251178a9
commit
70db735476
1 changed files with 6 additions and 2 deletions
|
@ -194,7 +194,7 @@ class NSClientV3Plugin @Inject constructor(
|
|||
disposable += rxBus
|
||||
.toObservable(EventAppExit::class.java)
|
||||
.observeOn(aapsSchedulers.io)
|
||||
.subscribe({ if (nsClientV3Service != null) context.unbindService(serviceConnection) }, fabricPrivacy::logException)
|
||||
.subscribe({ stopService() }, fabricPrivacy::logException)
|
||||
disposable += rxBus
|
||||
.toObservable(EventConnectivityOptionChanged::class.java)
|
||||
.observeOn(aapsSchedulers.io)
|
||||
|
@ -359,7 +359,11 @@ class NSClientV3Plugin @Inject constructor(
|
|||
}
|
||||
|
||||
private fun stopService() {
|
||||
if (nsClientV3Service != null) context.unbindService(serviceConnection)
|
||||
try {
|
||||
if (nsClientV3Service != null) context.unbindService(serviceConnection)
|
||||
} catch (e: Exception) {
|
||||
nsClientV3Service = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun resend(reason: String) {
|
||||
|
|
Loading…
Reference in a new issue