Skip to content

Commit

Permalink
fix: Null when unbind service
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Jamet committed Jul 28, 2023
1 parent d46f48f commit 68430ef
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,15 @@ class DatabaseTaskProvider(
* Unbind the service and assign null to the service connection to check if already unbind or not
*/
private fun unBindService() {
serviceConnection?.let {
context.unbindService(it)
try {
serviceConnection?.let {
context.unbindService(it)
}
} catch (e: java.lang.Exception) {
Log.e(TAG, "Unable to unbind the database task service", e)
} finally {
serviceConnection = null
}
serviceConnection = null
}

fun registerProgressTask() {
Expand Down

0 comments on commit 68430ef

Please sign in to comment.