Skip to content

Commit

Permalink
Guard isSupported() (#82)
Browse files Browse the repository at this point in the history
* Guard isSupported()

Co-authored-by: Armin Schrenk <[email protected]>
  • Loading branch information
purejava and infeo authored Jul 8, 2024
1 parent 34b7df8 commit df8bf11
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@OperatingSystem(OperatingSystem.Value.LINUX)
public class SecretServiceKeychainAccess implements KeychainAccessProvider {

private static Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);
private static final Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);

private final String LABEL_FOR_SECRET_IN_KEYRING = "Cryptomator";

Expand All @@ -29,8 +29,8 @@ public String displayName() {
public boolean isSupported() {
try {
return SimpleCollection.isAvailable();
} catch (ExceptionInInitializerError e) {
LOG.warn("Initializing secret service keychain access failed", e.getException());
} catch (RuntimeException | ExceptionInInitializerError e) {
LOG.warn("Initializing secret service keychain access failed", e instanceof ExceptionInInitializerError errInit ? errInit.getException() : e);
return false;
}
}
Expand Down

0 comments on commit df8bf11

Please sign in to comment.