graphql: handle missing block body in Raw resolver

This commit is contained in:
RekCuy63 2026-05-22 09:30:07 +08:00
parent 4daaaadfc4
commit bd28e43479

View file

@ -929,7 +929,7 @@ func (b *Block) RawHeader(ctx context.Context) (hexutil.Bytes, error) {
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) {
block, err := b.resolve(ctx)
if err != nil {
if err != nil || block == nil {
return hexutil.Bytes{}, err
}
return rlp.EncodeToBytes(block)