From afb9d4f01029f8de8155c9a7dd4ae2c55c93cab4 Mon Sep 17 00:00:00 2001 From: JaniruTEC Date: Fri, 6 Nov 2020 18:43:23 +0100 Subject: [PATCH] Fixed exception on startup if mount folder doesn't exist IrregularUnmountCleaner should not be called if there is no folder that could contain mountpoints. --- .../src/main/java/org/cryptomator/ui/launcher/UiLauncher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/launcher/UiLauncher.java b/main/ui/src/main/java/org/cryptomator/ui/launcher/UiLauncher.java index 6b2abb557..0fc8ab086 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/launcher/UiLauncher.java +++ b/main/ui/src/main/java/org/cryptomator/ui/launcher/UiLauncher.java @@ -16,6 +16,8 @@ import javafx.collections.ObservableList; import java.awt.Desktop; import java.awt.SystemTray; import java.awt.desktop.AppReopenedListener; +import java.nio.file.Files; +import java.nio.file.LinkOption; import java.util.Collection; import java.util.Optional; @@ -65,7 +67,7 @@ public class UiLauncher { //clean leftovers of not-regularly unmounted vaults //see https://github.com/cryptomator/cryptomator/issues/1013 and https://github.com/cryptomator/cryptomator/issues/1061 - env.getMountPointsDir().ifPresent(IrregularUnmountCleaner::removeUnregularUnmountDebris); + env.getMountPointsDir().filter(path -> Files.exists(path, LinkOption.NOFOLLOW_LINKS)).ifPresent(IrregularUnmountCleaner::removeUnregularUnmountDebris); // auto unlock Collection vaultsToAutoUnlock = vaults.filtered(this::shouldAttemptAutoUnlock);