File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
src/main/java/org/cryptomator/linux/keychain Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 9
9
import org .freedesktop .dbus .connections .impl .DBusConnectionBuilder ;
10
10
import org .freedesktop .dbus .exceptions .DBusConnectionException ;
11
11
import org .freedesktop .dbus .exceptions .DBusException ;
12
+ import org .freedesktop .dbus .exceptions .DBusExecutionException ;
12
13
import org .kde .KWallet ;
13
14
import org .kde .Static ;
14
15
import org .purejava .KDEWallet ;
@@ -28,7 +29,13 @@ public class KDEWalletKeychainAccess implements KeychainAccessProvider {
28
29
private final Optional <ConnectedWallet > wallet ;
29
30
30
31
public KDEWalletKeychainAccess () {
31
- this .wallet = ConnectedWallet .connect ();
32
+ Optional <ConnectedWallet > tmp ;
33
+ try { //TODO: remove try-catch once KDEWallet lib is fixed
34
+ tmp = ConnectedWallet .connect ();
35
+ } catch (DBusExecutionException e ) {
36
+ tmp = Optional .empty ();
37
+ }
38
+ wallet = tmp ;
32
39
}
33
40
34
41
@ Override
Original file line number Diff line number Diff line change 4
4
import org .cryptomator .integrations .common .Priority ;
5
5
import org .cryptomator .integrations .keychain .KeychainAccessException ;
6
6
import org .cryptomator .integrations .keychain .KeychainAccessProvider ;
7
+ import org .freedesktop .dbus .exceptions .DBusConnectionException ;
8
+ import org .freedesktop .dbus .exceptions .DBusExecutionException ;
7
9
import org .freedesktop .secret .simple .SimpleCollection ;
8
10
9
11
import java .io .IOException ;
@@ -23,7 +25,16 @@ public String displayName() {
23
25
24
26
@ Override
25
27
public boolean isSupported () {
26
- return SimpleCollection .isAvailable ();
28
+ try {
29
+ return SimpleCollection .isAvailable ();
30
+ } catch (ExceptionInInitializerError e ) {
31
+ //TODO: remove try-catch once secret-service lib is fixed
32
+ if (e .getException () instanceof DBusExecutionException ) {
33
+ return false ;
34
+ } else {
35
+ throw e ;
36
+ }
37
+ }
27
38
}
28
39
29
40
@ Override
You can’t perform that action at this time.
0 commit comments