Commit 6c381b0e authored by Max Lv's avatar Max Lv

Fix a crash reported by Goolge Play

parent e3f0fa67
...@@ -207,7 +207,22 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan ...@@ -207,7 +207,22 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
} }
def refreshProfile() { def refreshProfile() {
profile = app.currentProfile.get val profile = app.currentProfile match {
case Some(profile) => profile
case None => {
app.profileManager.getFirstProfile match {
case Some(profile) => {
app.profileId(profile.id)
profile
}
case None => {
val default = app.profileManager.createDefault()
app.profileId(default.id)
default
}
}
}
}
isProxyApps.setChecked(profile.proxyApps) isProxyApps.setChecked(profile.proxyApps)
} }
......
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