From c2890406242a1eff57389f8e4b7ab038c68deba7 Mon Sep 17 00:00:00 2001 From: infeo Date: Mon, 9 Jul 2018 18:43:45 +0200 Subject: [PATCH] fixes a display error where a vault appeared unlocked even when a wrong password was given --- .../java/org/cryptomator/ui/model/Vault.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java index ff7b842b6..5e2622024 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java +++ b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java @@ -100,15 +100,18 @@ public class Vault { } public synchronized void unlock(CharSequence passphrase) throws CryptoException, IOException, Volume.VolumeException { - Platform.runLater(() -> { - state.set(State.PROCESSING); - }); - CryptoFileSystem fs = getCryptoFileSystem(passphrase); - volume = volumeProvider.get(); - volume.mount(fs); - Platform.runLater(() -> { - state.set(State.UNLOCKED); - }); + Platform.runLater(() -> state.set(State.PROCESSING)); + try { + CryptoFileSystem fs = getCryptoFileSystem(passphrase); + volume = volumeProvider.get(); + volume.mount(fs); + Platform.runLater(() -> { + state.set(State.UNLOCKED); + }); + } catch (Exception e) { + Platform.runLater(() -> state.set(State.LOCKED)); + throw e; + } } public synchronized void lock(boolean forced) throws Volume.VolumeException {