mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
fix npe when performing soroban reply without utxos
This commit is contained in:
parent
4f4a48eb98
commit
f2e5259916
1 changed files with 14 additions and 0 deletions
|
@ -15,6 +15,10 @@ import com.sparrowwallet.drongo.wallet.WalletNode;
|
||||||
import com.sparrowwallet.sparrow.whirlpool.Whirlpool;
|
import com.sparrowwallet.sparrow.whirlpool.Whirlpool;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class SparrowCahootsWallet extends SimpleCahootsWallet {
|
public class SparrowCahootsWallet extends SimpleCahootsWallet {
|
||||||
private final Wallet wallet;
|
private final Wallet wallet;
|
||||||
private final int account;
|
private final int account;
|
||||||
|
@ -39,6 +43,16 @@ public class SparrowCahootsWallet extends SimpleCahootsWallet {
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<CahootsUtxo> fetchUtxos(int account) {
|
||||||
|
List<CahootsUtxo> utxos = super.fetchUtxos(account);
|
||||||
|
if(utxos == null) {
|
||||||
|
utxos = new LinkedList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return utxos;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pair<Integer, Integer> fetchReceiveIndex(int account) throws Exception {
|
public Pair<Integer, Integer> fetchReceiveIndex(int account) throws Exception {
|
||||||
if(account == StandardAccount.WHIRLPOOL_POSTMIX.getAccountNumber()) {
|
if(account == StandardAccount.WHIRLPOOL_POSTMIX.getAccountNumber()) {
|
||||||
|
|
Loading…
Reference in a new issue