diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.kt index 721bee15e..8b1f7926c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.kt @@ -159,9 +159,9 @@ class ZimHostActivity : BaseActivity(), ZimHostCallbacks, ZimHostContract.View { } private fun unbindService() { - if (hotspotService != null) { + hotspotService?.let { unbindService(serviceConnection) - hotspotService!!.registerCallBack(null) + it.registerCallBack(null) } }