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

Commit b81f93e

Browse files
committed
Fix validate profile
1 parent 42645f5 commit b81f93e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/profile.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,12 @@ func ValidateProfile(profile *pb.Profile) error {
363363
}
364364
if profile.ModeratorInfo.Fee != nil {
365365
var moderatorCurrencyCode string
366-
if profile.ModeratorInfo.Fee.FixedFee.AmountCurrency == nil {
367-
moderatorCurrencyCode = profile.ModeratorInfo.Fee.FixedFee.CurrencyCode
368-
} else {
369-
moderatorCurrencyCode = profile.ModeratorInfo.Fee.FixedFee.AmountCurrency.Code
366+
if profile.ModeratorInfo.Fee.FixedFee != nil {
367+
if profile.ModeratorInfo.Fee.FixedFee.AmountCurrency == nil {
368+
moderatorCurrencyCode = profile.ModeratorInfo.Fee.FixedFee.CurrencyCode
369+
} else {
370+
moderatorCurrencyCode = profile.ModeratorInfo.Fee.FixedFee.AmountCurrency.Code
371+
}
370372
}
371373

372374
if profile.ModeratorInfo.Fee.FeeType != pb.Moderator_Fee_PERCENTAGE && profile.ModeratorInfo.Fee.FixedFee != nil &&

0 commit comments

Comments
 (0)