Fix a crash when no profile selected

This commit is contained in:
Max Lv
2017-07-30 15:32:48 +08:00
parent adaca76b12
commit f19f8d8ffa
@@ -253,7 +253,13 @@ trait BaseService extends Service {
case State.STOPPED | State.IDLE =>
case _ => return Service.START_NOT_STICKY // ignore request
}
profile = app.currentProfile.orNull
if (profile == null) {
stopRunner(stopService = true)
return Service.START_NOT_STICKY
}
profile.name = profile.getName // save original name before it's (possibly) overwritten by IP addresses
TrafficMonitor.reset()