From f2f6e639dcd0b50124cc972040b1bef706cbd431 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 11 Oct 2022 15:40:50 +0200 Subject: [PATCH] minor fixes --- src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java | 2 +- .../com/sparrowwallet/sparrow/terminal/wallet/LoadWallet.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java b/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java index 4eb7ea6c..35ea0d13 100644 --- a/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java +++ b/src/main/java/com/sparrowwallet/sparrow/SparrowWallet.java @@ -86,7 +86,7 @@ public class SparrowWallet { SLF4JBridgeHandler.removeHandlersForRootLogger(); SLF4JBridgeHandler.install(); - if(args.terminal) { + if(args.terminal || java.awt.GraphicsEnvironment.isHeadless()) { PlatformImpl.setTaskbarApplication(false); com.sun.javafx.application.LauncherImpl.launchApplication(SparrowTerminal.class, SparrowWalletPreloader.class, argv); } else { diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/LoadWallet.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/LoadWallet.java index ce4e8d24..352f172a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/LoadWallet.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/LoadWallet.java @@ -150,7 +150,9 @@ public class LoadWallet implements Runnable { Set walletFiles = new LinkedHashSet<>(); walletFiles.add(storage.getWalletFile()); - walletFiles.addAll(Config.get().getRecentWalletFiles().stream().limit(MAX_RECENT_WALLETS - 1).collect(Collectors.toList())); + if(Config.get().getRecentWalletFiles() != null) { + walletFiles.addAll(Config.get().getRecentWalletFiles().stream().limit(MAX_RECENT_WALLETS - 1).collect(Collectors.toList())); + } Config.get().setRecentWalletFiles(Config.get().isLoadRecentWallets() ? new ArrayList<>(walletFiles) : Collections.emptyList()); }