diff --git a/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java b/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java index 30baaf99f..a248d08f5 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java @@ -9,6 +9,8 @@ interface KeychainAccessStrategy extends KeychainAccess { /** * @return true if this KeychainAccessStrategy works on the current machine. + * @implNote This method must not throw any exceptions and should fail fast + * returning false if it can't determine availability of the checked strategy */ boolean isSupported(); diff --git a/main/keychain/src/main/java/org/cryptomator/keychain/LinuxSecretServiceKeychainAccessImpl.java b/main/keychain/src/main/java/org/cryptomator/keychain/LinuxSecretServiceKeychainAccessImpl.java index 542c98c42..36a139a9f 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/LinuxSecretServiceKeychainAccessImpl.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/LinuxSecretServiceKeychainAccessImpl.java @@ -14,7 +14,7 @@ class LinuxSecretServiceKeychainAccessImpl implements KeychainAccessStrategy { try (@SuppressWarnings("unused") SimpleCollection keyring = new SimpleCollection()) { // seems like we're able to access the keyring. return true; - } catch (IOException e) { + } catch (IOException | RuntimeException e) { return false; } }