handle null label

This commit is contained in:
Craig Raw 2020-06-25 17:50:57 +02:00
parent ef2e2a1855
commit 183d0ded2f

View file

@ -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);
}