eth/tracers: fix nil pointer dereference in TraceCall with BlockOverrides

This commit is contained in:
allen 2025-10-24 09:03:13 -04:00
parent 0413af40f6
commit 6fe7d9de55

View file

@ -959,7 +959,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc
// Apply the customization rules if required.
if config != nil {
if config.BlockOverrides != nil && config.BlockOverrides.Number.ToInt().Uint64() == h.Number.Uint64()+1 {
if config.BlockOverrides != nil && config.BlockOverrides.Number != nil && config.BlockOverrides.Number.ToInt().Uint64() == h.Number.Uint64()+1 {
// Overriding the block number to n+1 is a common way for wallets to
// simulate transactions, however without the following fix, a contract
// can assert it is being simulated by checking if blockhash(n) == 0x0 and