diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 710a7ad22..9ce4a6799 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -614,6 +614,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