From 72a421206747dce6a9c6bf6f9100f0988ba22529 Mon Sep 17 00:00:00 2001 From: gachouchani1999 Date: Sun, 5 May 2024 22:52:07 +0300 Subject: [PATCH] set check for nil pointer for param --- x/distribution/keeper/allocation.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index 15eca8aa..286c2026 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -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 {