Skip to content

Commit df8bf11

Browse files
purejavainfeo
andauthored
Guard isSupported() (#82)
* Guard isSupported() Co-authored-by: Armin Schrenk <[email protected]>
1 parent 34b7df8 commit df8bf11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@OperatingSystem(OperatingSystem.Value.LINUX)
1717
public class SecretServiceKeychainAccess implements KeychainAccessProvider {
1818

19-
private static Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);
19+
private static final Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);
2020

2121
private final String LABEL_FOR_SECRET_IN_KEYRING = "Cryptomator";
2222

@@ -29,8 +29,8 @@ public String displayName() {
2929
public boolean isSupported() {
3030
try {
3131
return SimpleCollection.isAvailable();
32-
} catch (ExceptionInInitializerError e) {
33-
LOG.warn("Initializing secret service keychain access failed", e.getException());
32+
} catch (RuntimeException | ExceptionInInitializerError e) {
33+
LOG.warn("Initializing secret service keychain access failed", e instanceof ExceptionInInitializerError errInit ? errInit.getException() : e);
3434
return false;
3535
}
3636
}

0 commit comments

Comments
 (0)