diff --git a/app/src/main/java/com/cappielloantonio/tempo/util/Preferences.kt b/app/src/main/java/com/cappielloantonio/tempo/util/Preferences.kt index 636a26cd..714c4f50 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/util/Preferences.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/util/Preferences.kt @@ -174,7 +174,7 @@ object Preferences { @JvmStatic fun isInUseServerAddressLocal(): Boolean { - return getInUseServerAddress() == getLocalAddress() + return getInUseServerAddress() == getLocalAddress() && !getLocalAddress().isNullOrEmpty() } @JvmStatic @@ -187,7 +187,7 @@ object Preferences { fun isServerSwitchable(): Boolean { return App.getInstance().preferences.getLong( NEXT_SERVER_SWITCH, 0 - ) + 15000 < System.currentTimeMillis() + ) + 15000 < System.currentTimeMillis() && !getServer().isNullOrEmpty() && !getLocalAddress().isNullOrEmpty() } @JvmStatic