ForwardingService: fix possible NPE in coin selector

This commit is contained in:
Sean Gilligan 2023-08-02 16:10:57 -07:00 committed by Andreas Schildbach
parent 7aeffc4de0
commit e34dd300ec

View File

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