mirror of https://github.com/casbin/casnode.git
Fix crash in SetUserField()
This commit is contained in:
parent
2fabb62992
commit
926d922d06
|
@ -35,13 +35,12 @@ func GetUserFieldInt(user *casdoorsdk.User, field string) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetUserField(user *casdoorsdk.User, field string, value string) {
|
func SetUserField(user *casdoorsdk.User, field string, value string) {
|
||||||
|
if user.Properties == nil {
|
||||||
|
user.Properties = map[string]string{}
|
||||||
|
}
|
||||||
user.Properties[field] = value
|
user.Properties[field] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetUserFieldInt(user *casdoorsdk.User, field string, value int) {
|
|
||||||
user.Properties[field] = strconv.Itoa(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getInitScore() int {
|
func getInitScore() int {
|
||||||
score, err := strconv.Atoi(beego.AppConfig.String("initScore"))
|
score, err := strconv.Atoi(beego.AppConfig.String("initScore"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue