minor fixes

This commit is contained in:
Craig Raw 2022-10-11 15:40:50 +02:00
parent 78afc5e4d5
commit f2f6e639dc
2 changed files with 4 additions and 2 deletions

View file

@ -86,7 +86,7 @@ public class SparrowWallet {
SLF4JBridgeHandler.removeHandlersForRootLogger(); SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install(); SLF4JBridgeHandler.install();
if(args.terminal) { if(args.terminal || java.awt.GraphicsEnvironment.isHeadless()) {
PlatformImpl.setTaskbarApplication(false); PlatformImpl.setTaskbarApplication(false);
com.sun.javafx.application.LauncherImpl.launchApplication(SparrowTerminal.class, SparrowWalletPreloader.class, argv); com.sun.javafx.application.LauncherImpl.launchApplication(SparrowTerminal.class, SparrowWalletPreloader.class, argv);
} else { } else {

View file

@ -150,7 +150,9 @@ public class LoadWallet implements Runnable {
Set<File> walletFiles = new LinkedHashSet<>(); Set<File> walletFiles = new LinkedHashSet<>();
walletFiles.add(storage.getWalletFile()); 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()); Config.get().setRecentWalletFiles(Config.get().isLoadRecentWallets() ? new ArrayList<>(walletFiles) : Collections.emptyList());
} }