File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1675,7 +1675,7 @@ func (api *DebugAPI) GetRawHeader(ctx context.Context, blockNrOrHash rpc.BlockNu
1675
1675
hash = h
1676
1676
} else {
1677
1677
block , err := api .b .BlockByNumberOrHash (ctx , blockNrOrHash )
1678
- if err != nil {
1678
+ if block == nil || err != nil {
1679
1679
return nil , err
1680
1680
}
1681
1681
hash = block .Hash ()
@@ -1694,7 +1694,7 @@ func (api *DebugAPI) GetRawBlock(ctx context.Context, blockNrOrHash rpc.BlockNum
1694
1694
hash = h
1695
1695
} else {
1696
1696
block , err := api .b .BlockByNumberOrHash (ctx , blockNrOrHash )
1697
- if err != nil {
1697
+ if block == nil || err != nil {
1698
1698
return nil , err
1699
1699
}
1700
1700
hash = block .Hash ()
@@ -1713,7 +1713,7 @@ func (api *DebugAPI) GetRawReceipts(ctx context.Context, blockNrOrHash rpc.Block
1713
1713
hash = h
1714
1714
} else {
1715
1715
block , err := api .b .BlockByNumberOrHash (ctx , blockNrOrHash )
1716
- if err != nil {
1716
+ if block == nil || err != nil {
1717
1717
return nil , err
1718
1718
}
1719
1719
hash = block .Hash ()
You can’t perform that action at this time.
0 commit comments