diff --git a/service/service_user/update_user_info.go b/service/service_user/update_user_info.go index 3e4b19c..109b0b9 100644 --- a/service/service_user/update_user_info.go +++ b/service/service_user/update_user_info.go @@ -39,7 +39,25 @@ func (self *UserServiceImpl) UpdateUserInfo(payload *UserInfoPayload) (result *U } if payload.Data.Nickname != nil { - if utf8.RuneCountInString(*payload.Data.Nickname) > 24 { + val := *payload.Data.Nickname + if val == "" { + execption := new(exception.Builder). + SetStatus(exception.StatusUser). + SetService(exception.ServiceUser). + SetType(exception.TypeCommon). + SetOriginal(exception.CommonErrorInvalidInput) + + result = &UserInfoResult{ + Common: shared.CommonResult{ + HttpCode: 400, + Exception: execption, + }, + Data: nil, + } + + return + } + if utf8.RuneCountInString(val) > 24 { execption := new(exception.Builder). SetStatus(exception.StatusUser). SetService(exception.ServiceUser).