graphql: add nil checks in Block resolver methods

This commit is contained in:
rizkyikiw42 2025-11-20 10:54:00 +08:00
parent e0d81d1e99
commit e4c011b8bc

View file

@ -707,6 +707,9 @@ func (b *Block) resolveHeader(ctx context.Context) (*types.Header, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if b.header == nil {
return nil, nil
}
if b.hash == (common.Hash{}) { if b.hash == (common.Hash{}) {
b.hash = b.header.Hash() b.hash = b.header.Hash()
} }