From 9a2643ec2c58f397c7f6d756b3ea5260e7e8581a Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 14 Dec 2017 11:59:50 -0800 Subject: [PATCH] Add missing error message --- .../src/main/java/com/github/shadowsocks/bg/BaseService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt b/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt index 1538b5cc..52668a39 100644 --- a/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt +++ b/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt @@ -303,8 +303,9 @@ object BaseService { val data = data if (data.state != STOPPED) return Service.START_NOT_STICKY val profile = app.currentProfile + this as Context if (profile == null) { - stopRunner(true) + stopRunner(true, getString(R.string.profile_empty)) return Service.START_NOT_STICKY } data.profile = profile @@ -321,7 +322,7 @@ object BaseService { filter.addAction(Action.RELOAD) filter.addAction(Intent.ACTION_SHUTDOWN) filter.addAction(Action.CLOSE) - (this as Context).registerReceiver(data.closeReceiver, filter) + registerReceiver(data.closeReceiver, filter) data.closeReceiverRegistered = true } @@ -331,7 +332,6 @@ object BaseService { data.changeState(CONNECTING) thread { - this as Context try { if (profile.host == "198.199.101.152") { val client = OkHttpClient.Builder()