diff --git a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java index 69df1b1a1..61d376793 100644 --- a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java +++ b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java @@ -193,7 +193,7 @@ public class ForwardingService implements Closeable { */ static CoinSelector forwardingCoinSelector(Sha256Hash parentTxId) { return (target, candidates) -> candidates.stream() - .filter(output -> output.getParentTransactionHash().equals(parentTxId)) + .filter(output -> output.getParentTransactionHash() != null && output.getParentTransactionHash().equals(parentTxId)) .collect(collectingAndThen(toList(), CoinSelection::new)); } }