Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 38d84ca

Browse files
committed
Core/profile refactor fee type check
1 parent 8684637 commit 38d84ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/profile.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ func (n *OpenBazaarNode) PatchProfile(patch map[string]interface{}) error {
195195

196196
repoProfile.NormalizeDataForAllSchemas()
197197

198-
if repoProfile.GetProtobuf().ModeratorInfo != nil && repoProfile.GetProtobuf().ModeratorInfo.Fee != nil {
199-
if repoProfile.GetProtobuf().ModeratorInfo.Fee.FeeType == pb.Moderator_Fee_PERCENTAGE {
200-
repoProfile.GetProtobuf().ModeratorInfo.Fee.FixedFee = nil
201-
}
198+
if repoProfile.GetProtobuf().ModeratorInfo != nil &&
199+
repoProfile.GetProtobuf().ModeratorInfo.Fee != nil &&
200+
repoProfile.GetProtobuf().ModeratorInfo.Fee.FeeType == pb.Moderator_Fee_PERCENTAGE {
201+
202+
repoProfile.GetProtobuf().ModeratorInfo.Fee.FixedFee = nil
202203
}
203204

204205
if err := repoProfile.Valid(); err != nil {

0 commit comments

Comments
 (0)