Commit 19c49107 authored by Max Lv's avatar Max Lv

ignore all exceptions when upgrading the preference

parent 8b0b39cb
......@@ -167,10 +167,11 @@ class Shadowsocks
ShadowsocksApplication.settings.edit.putBoolean(ShadowsocksApplication.getVersionName, true).apply()
recovery()
// Workaround that convert port(String) to port(Int)
val oldLocalPort = ShadowsocksApplication.settings.getString("port", "-1")
val oldRemotePort = ShadowsocksApplication.settings.getString("remotePort", "-1")
try {
// Workaround that convert port(String) to port(Int)
val oldLocalPort = ShadowsocksApplication.settings.getString("port", "-1")
val oldRemotePort = ShadowsocksApplication.settings.getString("remotePort", "-1")
if (oldLocalPort != "-1") {
ShadowsocksApplication.settings.edit.putInt(Key.localPort, oldLocalPort.toInt).commit()
}
......
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