Skip to content

Commit

Permalink
fixed bug with nil pointer exception during simulation (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
swelf19 committed May 20, 2024
1 parent d90e573 commit 284047a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/feemarket/post/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (dfd FeeMarketDeductDecorator) DeductFeeAndTip(ctx sdk.Context, sdkTx sdk.T
var events sdk.Events

// deduct the fees and tip
if !fee.IsZero() {
if !fee.Amount.IsNil() && !fee.IsZero() {
err := DeductCoins(dfd.bankKeeper, ctx, deductFeesFromAcc, sdk.NewCoins(fee), distributeFees)
if err != nil {
return err
Expand All @@ -186,7 +186,7 @@ func (dfd FeeMarketDeductDecorator) DeductFeeAndTip(ctx sdk.Context, sdkTx sdk.T
}

proposer := sdk.AccAddress(ctx.BlockHeader().ProposerAddress)
if !tip.IsZero() {
if !tip.Amount.IsNil() && !tip.IsZero() {
err := SendTip(dfd.bankKeeper, ctx, deductFeesFromAcc.GetAddress(), proposer, sdk.NewCoins(tip))
if err != nil {
return err
Expand Down

0 comments on commit 284047a

Please sign in to comment.