diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationStyle.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationStyle.java index cf524b449..6a7ef934c 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationStyle.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationStyle.java @@ -72,14 +72,15 @@ public class FxApplicationStyle { } private void registerAutomaticThemeChange() { - appearanceProvider.ifPresent(provider -> { - try { - provider.addListener(systemInterfaceThemeListener); - } catch (UiAppearanceException e) { - LOG.error("Failed to enable automatic theme switching."); - } - systemInterfaceThemeChanged(provider.getSystemTheme()); - }); + appearanceProvider.ifPresentOrElse(provider -> { + try { + provider.addListener(systemInterfaceThemeListener); + } catch (UiAppearanceException e) { + LOG.error("Failed to enable automatic theme switching."); + } + systemInterfaceThemeChanged(provider.getSystemTheme()); + }, // + () -> LOG.warn("UI theme AUTOMATIC selected, but no supported UiAppearanceProvider present")); } private void systemInterfaceThemeChanged(Theme osTheme) {