From 183d0ded2f510924571c33869254a4943a1814a8 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 25 Jun 2020 17:50:57 +0200 Subject: [PATCH] handle null label --- src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java b/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java index c4c68830..d115b471 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java +++ b/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 optionalLabel = node.getTransactionOutputs().stream().filter(oldTxo -> oldTxo.getHash().equals(txo.getHash()) && oldTxo.getIndex() == txo.getIndex()).map(BlockTransactionHash::getLabel).findFirst(); + Optional 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); }