From d4f338f1acc3475a21bdb6b476a658f38f681721 Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Wed, 18 Jan 2023 21:07:06 +0530 Subject: [PATCH] added check for deposit addr --- x/interchainstaking/keeper/zones.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/interchainstaking/keeper/zones.go b/x/interchainstaking/keeper/zones.go index 63aec9d14..8dcbf8818 100644 --- a/x/interchainstaking/keeper/zones.go +++ b/x/interchainstaking/keeper/zones.go @@ -179,8 +179,11 @@ func (k *Keeper) EnsureWithdrawalAddresses(ctx sdk.Context, zone *types.Zone) er return nil } withdrawalAddress := zone.WithdrawalAddress.Address - - if zone.DepositAddress.WithdrawalAddress != zone.DepositAddress.Address { + if zone.DepositAddress == nil { + k.Logger(ctx).Info("Deposit address not set") + return nil + } + if zone.DepositAddress.WithdrawalAddress != zone.WithdrawalAddress.Address { msg := distrTypes.MsgSetWithdrawAddress{DelegatorAddress: zone.DepositAddress.Address, WithdrawAddress: withdrawalAddress} err := k.SubmitTx(ctx, []sdk.Msg{&msg}, zone.DepositAddress, "") if err != nil {