Skip to content

Commit

Permalink
fix: avoid validation for duration == nil
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Sep 13, 2022
1 parent 733e505 commit 6649d74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x/marketplace/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 6649d74

Please sign in to comment.