diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7df46b1f33..0c2f5ba2cb 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -628,6 +628,10 @@ func (s *PublicBlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, return nil, err } + if block == nil { + return nil, errors.New("block not found") + } + receipts, err := s.b.GetReceipts(ctx, block.Hash()) if err != nil { return nil, err