Skip to content

Commit

Permalink
internal/api: return empty array rather than nil (#2385)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlacfzy authored Apr 10, 2024
1 parent d7836bf commit 009df5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ func (s *BlockChainAPI) GetBlobSidecars(ctx context.Context, blockNrOrHash rpc.B
return nil, nil
}
blobSidecars, err := s.b.GetBlobSidecars(ctx, header.Hash())
if err != nil || len(blobSidecars) == 0 {
if err != nil || blobSidecars == nil {
return nil, nil
}
result := make([]map[string]interface{}, len(blobSidecars))
Expand All @@ -1040,7 +1040,7 @@ func (s *BlockChainAPI) GetBlobSidecarByTxHash(ctx context.Context, hash common.
return nil, nil
}
blobSidecars, err := s.b.GetBlobSidecars(ctx, blockHash)
if err != nil || len(blobSidecars) == 0 {
if err != nil || blobSidecars == nil || len(blobSidecars) == 0 {
return nil, nil
}
for _, sidecar := range blobSidecars {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
null
[]

0 comments on commit 009df5a

Please sign in to comment.