From e723b622c88defe9e65c21209ca7f67437de5464 Mon Sep 17 00:00:00 2001 From: Preeti <35308865+pr9t@users.noreply.github.com> Date: Fri, 11 Oct 2024 04:44:34 +0530 Subject: [PATCH] Chore:Resolved java Util NoSuchElementException (#7730) * Chore:Resolved java Util NoSuchElementException Signed-off-by: Preeti <35308865+pr9t@users.noreply.github.com> * formatting Signed-off-by: Sally MacFarlane --------- Signed-off-by: Preeti <35308865+pr9t@users.noreply.github.com> Signed-off-by: Sally MacFarlane Co-authored-by: Sally MacFarlane --- .../api/jsonrpc/internal/methods/EthGetBlockReceipts.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java index a113e4ee8e..819ac5e1eb 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java @@ -95,7 +95,8 @@ public class EthGetBlockReceipts extends AbstractBlockParameterOrBlockHashMethod .map( block -> block.getTransactions().stream() - .map(tx -> txReceipt(tx).get()) + .map(this::txReceipt) + .flatMap(Optional::stream) .collect(Collectors.toList())) .orElse(new ArrayList<>());