diff --git a/object/user_util.go b/object/user_util.go index 1771e775..75588272 100644 --- a/object/user_util.go +++ b/object/user_util.go @@ -293,7 +293,13 @@ func CheckPermissionForUpdateUser(oldUser, newUser *User, isAdmin bool, lang str itemsChanged = append(itemsChanged, item) } + if oldUser.Groups == nil { + oldUser.Groups = []string{} + } oldUserGroupsJson, _ := json.Marshal(oldUser.Groups) + if newUser.Groups == nil { + newUser.Groups = []string{} + } newUserGroupsJson, _ := json.Marshal(newUser.Groups) if string(oldUserGroupsJson) != string(newUserGroupsJson) { item := GetAccountItemByName("Groups", organization)