Skip to content

Commit 6fe7d9d

Browse files
committed
eth/tracers: fix nil pointer dereference in TraceCall with BlockOverrides
1 parent 0413af4 commit 6fe7d9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eth/tracers/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc
959959

960960
// Apply the customization rules if required.
961961
if config != nil {
962-
if config.BlockOverrides != nil && config.BlockOverrides.Number.ToInt().Uint64() == h.Number.Uint64()+1 {
962+
if config.BlockOverrides != nil && config.BlockOverrides.Number != nil && config.BlockOverrides.Number.ToInt().Uint64() == h.Number.Uint64()+1 {
963963
// Overriding the block number to n+1 is a common way for wallets to
964964
// simulate transactions, however without the following fix, a contract
965965
// can assert it is being simulated by checking if blockhash(n) == 0x0 and

0 commit comments

Comments
 (0)