Browse Source

handle null label

bwt
Craig Raw 5 years ago
parent
commit
183d0ded2f
  1. 2
      src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java

2
src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java

@ -482,7 +482,7 @@ public class ElectrumServer {
if(!transactionOutputs.equals(node.getTransactionOutputs())) {
for(BlockTransactionHashIndex txo : transactionOutputs) {
Optional<String> optionalLabel = node.getTransactionOutputs().stream().filter(oldTxo -> oldTxo.getHash().equals(txo.getHash()) && oldTxo.getIndex() == txo.getIndex()).map(BlockTransactionHash::getLabel).findFirst();
Optional<String> optionalLabel = node.getTransactionOutputs().stream().filter(oldTxo -> oldTxo.getHash().equals(txo.getHash()) && oldTxo.getIndex() == txo.getIndex() && oldTxo.getLabel() != null).map(BlockTransactionHash::getLabel).findFirst();
optionalLabel.ifPresent(txo::setLabel);
}

Loading…
Cancel
Save