Skip to content

Commit

Permalink
set check for nil pointer for param
Browse files Browse the repository at this point in the history
  • Loading branch information
gachouchani1999 committed May 5, 2024
1 parent 812db6d commit 72a4212
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/distribution/keeper/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, bonded
// Calculate rewards to be dripped this block from Param set
rewardsToDrip := k.GetRewardsPerBlock(ctx)

// If rewardsToDrip is nil set to 0
if rewardsToDrip.IsNil() {

rewardsToDrip = sdk.ZeroDec()

}

// Create new coins with the denoms of the rewardsDripperBalance and the amount of rewards to be dripped
rewardsCoins := make(sdk.Coins, len(rewardsDripperBalance))
for i, coin := range rewardsDripperBalance {
Expand Down

0 comments on commit 72a4212

Please sign in to comment.