From d51debf736b980f53575fd91fe6d64fb48c9061a Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 1 Aug 2019 13:24:47 +0200 Subject: [PATCH] fixed exception when scheduling the next regular update check while auto check is disabled [ci skip] --- .../java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java b/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java index 73c479579..7784bd89e 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java @@ -24,6 +24,7 @@ public abstract class UpdateCheckerModule { private static final URI LATEST_VERSION_URI = URI.create("https://api.cryptomator.org/updates/latestVersion.json"); private static final Duration UPDATE_CHECK_INTERVAL = Duration.hours(3); + private static final Duration DISABLED_UPDATE_CHECK_INTERVAL = Duration.hours(100000); // Duration.INDEFINITE leads to overflows... @Provides @Named("latestVersion") @@ -56,7 +57,7 @@ public abstract class UpdateCheckerModule { @Named("checkForUpdatesInterval") @FxApplicationScoped static ObjectBinding provideCheckForUpdateInterval(Settings settings) { - return Bindings.when(settings.checkForUpdates()).then(UPDATE_CHECK_INTERVAL).otherwise(Duration.INDEFINITE); + return Bindings.when(settings.checkForUpdates()).then(UPDATE_CHECK_INTERVAL).otherwise(DISABLED_UPDATE_CHECK_INTERVAL); } @Provides