Skip to content

Commit

Permalink
Add missing nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Sep 13, 2024
1 parent c104cf6 commit 8364899
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,14 @@ func RunPrecompiledContract(p PrecompiledContract, input []byte, suppliedGas uin
if suppliedGas < gasCost {
return nil, 0, ErrOutOfGas
}
logger := evm.Config.Tracer
if logger != nil && logger.OnGasChange != nil {
logger.OnGasChange(suppliedGas, suppliedGas-gasCost, tracing.GasChangeCallPrecompiledContract)

if evm != nil {
logger := evm.Config.Tracer
if logger != nil && logger.OnGasChange != nil {
logger.OnGasChange(suppliedGas, suppliedGas-gasCost, tracing.GasChangeCallPrecompiledContract)
}
}

suppliedGas -= gasCost
output, err := p.Run(input, evm, caller)
return output, suppliedGas, err
Expand Down

0 comments on commit 8364899

Please sign in to comment.