From 0745d21761c38c2188371d60d23a248960c2036a Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 8 Jun 2023 08:58:43 +0200 Subject: [PATCH] fix export to specter desktop without any wallet history --- src/main/java/com/sparrowwallet/sparrow/io/SpecterDesktop.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/SpecterDesktop.java b/src/main/java/com/sparrowwallet/sparrow/io/SpecterDesktop.java index 43bcfde6..44b83cc3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/SpecterDesktop.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/SpecterDesktop.java @@ -22,7 +22,7 @@ public class SpecterDesktop implements WalletImport, WalletExport { try { SpecterWallet specterWallet = new SpecterWallet(); specterWallet.label = wallet.getFullName(); - specterWallet.blockheight = wallet.getTransactions().values().stream().mapToInt(BlockTransactionHash::getHeight).min().orElse(wallet.getStoredBlockHeight()); + specterWallet.blockheight = wallet.getTransactions().values().stream().mapToInt(BlockTransactionHash::getHeight).min().orElse(wallet.getStoredBlockHeight() == null ? 0 : wallet.getStoredBlockHeight()); specterWallet.descriptor = OutputDescriptor.getOutputDescriptor(wallet).toString(true); Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();