Skip to content

Commit

Permalink
formalize nil pointer panic (sei-protocol#1763)
Browse files Browse the repository at this point in the history
  • Loading branch information
udpatil authored Jul 26, 2024
1 parent 645b3a9 commit 0e70eb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/evm/keeper/deferred.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func (k *Keeper) GetAllEVMTxDeferredInfo(ctx sdk.Context) (res []*types.Deferred
// this means the transaction got reverted during execution, either in ante handler
// or due to a panic in msg server
etx, _ := msg.AsTransaction()
if etx == nil {
panic("etx is nil for EVM DeferredInfo msg.AsTransaction(). This should never happen.")
}
if txRes.Code == 0 {
ctx.Logger().Error(fmt.Sprintf("transaction %s has code 0 but no deferred info", etx.Hash().Hex()))
}
Expand Down

0 comments on commit 0e70eb8

Please sign in to comment.