Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
check for if commit function is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Aug 10, 2021
1 parent 0d97f6f commit 3a8c511
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/evm/keeper/context_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ func (cs *ContextStack) Commit() {
for i := len(cs.cachedContexts) - 1; i >= 0; i-- {
// keep all the cosmos events
cs.initialCtx.EventManager().EmitEvents(cs.cachedContexts[i].ctx.EventManager().Events())
cs.cachedContexts[i].commit()
if cs.cachedContexts[i].commit == nil {
panic("commit function should not be nil")
} else {
cs.cachedContexts[i].commit()
}
}
cs.cachedContexts = []cachedContext{}
}
Expand Down

0 comments on commit 3a8c511

Please sign in to comment.