Commit 9a2643ec authored by Mygod's avatar Mygod

Add missing error message

parent 5c2d548d
...@@ -303,8 +303,9 @@ object BaseService { ...@@ -303,8 +303,9 @@ object BaseService {
val data = data val data = data
if (data.state != STOPPED) return Service.START_NOT_STICKY if (data.state != STOPPED) return Service.START_NOT_STICKY
val profile = app.currentProfile val profile = app.currentProfile
this as Context
if (profile == null) { if (profile == null) {
stopRunner(true) stopRunner(true, getString(R.string.profile_empty))
return Service.START_NOT_STICKY return Service.START_NOT_STICKY
} }
data.profile = profile data.profile = profile
...@@ -321,7 +322,7 @@ object BaseService { ...@@ -321,7 +322,7 @@ object BaseService {
filter.addAction(Action.RELOAD) filter.addAction(Action.RELOAD)
filter.addAction(Intent.ACTION_SHUTDOWN) filter.addAction(Intent.ACTION_SHUTDOWN)
filter.addAction(Action.CLOSE) filter.addAction(Action.CLOSE)
(this as Context).registerReceiver(data.closeReceiver, filter) registerReceiver(data.closeReceiver, filter)
data.closeReceiverRegistered = true data.closeReceiverRegistered = true
} }
...@@ -331,7 +332,6 @@ object BaseService { ...@@ -331,7 +332,6 @@ object BaseService {
data.changeState(CONNECTING) data.changeState(CONNECTING)
thread { thread {
this as Context
try { try {
if (profile.host == "198.199.101.152") { if (profile.host == "198.199.101.152") {
val client = OkHttpClient.Builder() val client = OkHttpClient.Builder()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment