From 490c44788a881da19f730bce6eca9db68bbe96ef Mon Sep 17 00:00:00 2001 From: Dzung Do Date: Wed, 15 Jan 2025 16:18:47 +0700 Subject: [PATCH] fix error --- modules/multistaking/handle_msg.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/multistaking/handle_msg.go b/modules/multistaking/handle_msg.go index 47c086056..7a83ac044 100644 --- a/modules/multistaking/handle_msg.go +++ b/modules/multistaking/handle_msg.go @@ -197,15 +197,16 @@ func (m *Module) UpdateUnlockToken(height int64, stakerAddr string, valAddr stri total[denom] = value.Add(amount) } } - - for _, entry := range unlock.Entries { - denom := entry.UnlockingCoin.Denom - amount := entry.UnlockingCoin.Amount - value, exists := total[denom] - if !exists { - total[denom] = amount - } else { - total[denom] = value.Add(amount) + if unlock != nil { + for _, entry := range unlock.Entries { + denom := entry.UnlockingCoin.Denom + amount := entry.UnlockingCoin.Amount + value, exists := total[denom] + if !exists { + total[denom] = amount + } else { + total[denom] = value.Add(amount) + } } }