From f2e5259916812ace1de2e67384ae68435852591d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 13 Jan 2022 16:22:20 +0200 Subject: [PATCH] fix npe when performing soroban reply without utxos --- .../sparrow/soroban/SparrowCahootsWallet.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/soroban/SparrowCahootsWallet.java b/src/main/java/com/sparrowwallet/sparrow/soroban/SparrowCahootsWallet.java index 1a1fde11..eb0c2915 100644 --- a/src/main/java/com/sparrowwallet/sparrow/soroban/SparrowCahootsWallet.java +++ b/src/main/java/com/sparrowwallet/sparrow/soroban/SparrowCahootsWallet.java @@ -15,6 +15,10 @@ import com.sparrowwallet.drongo.wallet.WalletNode; import com.sparrowwallet.sparrow.whirlpool.Whirlpool; import org.apache.commons.lang3.tuple.Pair; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + public class SparrowCahootsWallet extends SimpleCahootsWallet { private final Wallet wallet; private final int account; @@ -39,6 +43,16 @@ public class SparrowCahootsWallet extends SimpleCahootsWallet { return account; } + @Override + protected List fetchUtxos(int account) { + List utxos = super.fetchUtxos(account); + if(utxos == null) { + utxos = new LinkedList<>(); + } + + return utxos; + } + @Override public Pair fetchReceiveIndex(int account) throws Exception { if(account == StandardAccount.WHIRLPOOL_POSTMIX.getAccountNumber()) {