ignore all exceptions when upgrading the preference

This commit is contained in:
Max Lv
2015-11-24 14:48:15 +08:00
parent 8b0b39cba7
commit 19c4910794
@@ -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()
}