Fix: App crashes on second open when local address empty
This commit is contained in:
@@ -174,7 +174,7 @@ object Preferences {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun isInUseServerAddressLocal(): Boolean {
|
fun isInUseServerAddressLocal(): Boolean {
|
||||||
return getInUseServerAddress() == getLocalAddress()
|
return getInUseServerAddress() == getLocalAddress() && !getLocalAddress().isNullOrEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@@ -187,7 +187,7 @@ object Preferences {
|
|||||||
fun isServerSwitchable(): Boolean {
|
fun isServerSwitchable(): Boolean {
|
||||||
return App.getInstance().preferences.getLong(
|
return App.getInstance().preferences.getLong(
|
||||||
NEXT_SERVER_SWITCH, 0
|
NEXT_SERVER_SWITCH, 0
|
||||||
) + 15000 < System.currentTimeMillis()
|
) + 15000 < System.currentTimeMillis() && !getServer().isNullOrEmpty() && !getLocalAddress().isNullOrEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|||||||
Reference in New Issue
Block a user