From 4abf20fa322de0afc576d418ea124367d14c9e59 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Sun, 20 Sep 2020 18:59:26 -0400 Subject: [PATCH] Fix protect() when there is no service --- .../main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt index a85e8467..cbe6ddeb 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt @@ -88,7 +88,7 @@ object V2RayServiceManager { } override fun protect(l: Long): Long { - val serviceControl = serviceControl?.get() ?: return 1 + val serviceControl = serviceControl?.get() ?: return 0 return if (serviceControl.vpnProtect(l.toInt())) 0 else 1 }