Skip to content

Commit

Permalink
chore: add nil check in StateDB.AddLog
Browse files Browse the repository at this point in the history
  • Loading branch information
arrivets committed Oct 22, 2024
1 parent ba1afe5 commit 5d3ad48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/evm/statedb/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 5d3ad48

Please sign in to comment.