From 6649d742292b13e96599862d7597272ac8a4848d Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Tue, 13 Sep 2022 19:53:44 +0530 Subject: [PATCH] fix: avoid validation for duration == nil --- x/marketplace/types/msgs.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/marketplace/types/msgs.go b/x/marketplace/types/msgs.go index 467a844..9d3f866 100644 --- a/x/marketplace/types/msgs.go +++ b/x/marketplace/types/msgs.go @@ -229,8 +229,10 @@ func (msg MsgCreateAuction) ValidateBasic() error { if err = ValidatePrice(msg.StartPrice); err != nil { return err } - if err = ValidateDuration(*msg.Duration); err != nil { - return err + if msg.Duration != nil { + if err = ValidateDuration(msg.Duration); err != nil { + return err + } } if !msg.IncrementPercentage.IsPositive() || !msg.IncrementPercentage.LTE(sdk.NewDec(1)) { return sdkerrors.Wrapf(ErrInvalidPercentage, "invalid percentage value (%s)", msg.IncrementPercentage.String())