mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
graphql: handle nil block in Raw method
This commit is contained in:
parent
723aae2b4e
commit
c49faf7f60
1 changed files with 1 additions and 1 deletions
|
|
@ -929,7 +929,7 @@ func (b *Block) RawHeader(ctx context.Context) (hexutil.Bytes, error) {
|
||||||
|
|
||||||
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) {
|
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) {
|
||||||
block, err := b.resolve(ctx)
|
block, err := b.resolve(ctx)
|
||||||
if err != nil {
|
if err != nil || block == nil {
|
||||||
return hexutil.Bytes{}, err
|
return hexutil.Bytes{}, err
|
||||||
}
|
}
|
||||||
return rlp.EncodeToBytes(block)
|
return rlp.EncodeToBytes(block)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue