From 5d3ad487731ba8de504dceeb9e10bf203e075d04 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Mon, 21 Oct 2024 17:41:52 +0200 Subject: [PATCH] chore: add nil check in StateDB.AddLog --- x/evm/statedb/statedb.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/evm/statedb/statedb.go b/x/evm/statedb/statedb.go index b3cc167185..577ff077c0 100644 --- a/x/evm/statedb/statedb.go +++ b/x/evm/statedb/statedb.go @@ -17,10 +17,11 @@ package statedb import ( "fmt" - cosmostracing "github.com/evmos/ethermint/x/evm/tracing" "math/big" "sort" + cosmostracing "github.com/evmos/ethermint/x/evm/tracing" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" "cosmossdk.io/store/cachemulti" @@ -170,7 +171,7 @@ func (s *StateDB) AddLog(log *ethtypes.Log) { log.Index = s.txConfig.LogIndex + uint(len(s.logs)) s.logs = append(s.logs, log) - if s.evmTracer != nil && s.evmTracer.OnLog != nil { + if log != nil && s.evmTracer != nil && s.evmTracer.OnLog != nil { s.evmTracer.OnLog(log) } }