Skip to content

Commit

Permalink
fix(member): allowing requests with nil immutables or mutables
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshutr committed Apr 23, 2024
1 parent 55b7b1b commit 424ae50
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions x/classifications/auxiliaries/member/auxiliary_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ func (auxiliaryRequest auxiliaryRequest) Validate() error {
return errorConstants.InvalidRequest.Wrapf("invalid classification id: %s", err.Error())
}

if err := auxiliaryRequest.Immutables.ValidateBasic(); err != nil {
return errorConstants.InvalidRequest.Wrapf("invalid immutables: %s", err.Error())
if auxiliaryRequest.Immutables != nil {
if err := auxiliaryRequest.Immutables.ValidateBasic(); err != nil {
return errorConstants.InvalidRequest.Wrapf("invalid immutables: %s", err.Error())
}
}

if err := auxiliaryRequest.Mutables.ValidateBasic(); err != nil {
return errorConstants.InvalidRequest.Wrapf("invalid mutables: %s", err.Error())
if auxiliaryRequest.Mutables != nil {
if err := auxiliaryRequest.Mutables.ValidateBasic(); err != nil {
return errorConstants.InvalidRequest.Wrapf("invalid mutables: %s", err.Error())
}
}

return nil
Expand Down

0 comments on commit 424ae50

Please sign in to comment.