Fix crash in SetUserField()

This commit is contained in:
Gucheng Wang 2023-02-02 21:09:51 +08:00
parent 2fabb62992
commit 926d922d06
1 changed files with 3 additions and 4 deletions

View File

@ -35,13 +35,12 @@ func GetUserFieldInt(user *casdoorsdk.User, field string) int {
}
func SetUserField(user *casdoorsdk.User, field string, value string) {
if user.Properties == nil {
user.Properties = map[string]string{}
}
user.Properties[field] = value
}
func SetUserFieldInt(user *casdoorsdk.User, field string, value int) {
user.Properties[field] = strconv.Itoa(value)
}
func getInitScore() int {
score, err := strconv.Atoi(beego.AppConfig.String("initScore"))
if err != nil {