internal/api: return empty array rather than nil (#2385)
This commit is contained in:
parent
d7836bfe98
commit
009df5a121
@ -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))
|
||||
@ -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 {
|
||||
|
@ -1 +1 @@
|
||||
null
|
||||
[]
|
Loading…
Reference in New Issue
Block a user