mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
graphql: add nil checks in Block resolver methods
This commit is contained in:
parent
e0d81d1e99
commit
e4c011b8bc
1 changed files with 3 additions and 0 deletions
|
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue