[MM-18544] Initialise UserSearch struct before trying to decode JSON (#12198)

Этот коммит содержится в:
Miguel de la Cruz
2019-09-13 19:58:27 +02:00
коммит произвёл Joram Wilander
родитель 4c4fbdc652
Коммит 85ce27fc93

Просмотреть файл

@@ -33,14 +33,14 @@ func (u *UserSearch) ToJson() []byte {
// UserSearchFromJson will decode the input and return a User
func UserSearchFromJson(data io.Reader) *UserSearch {
var us *UserSearch
us := UserSearch{}
json.NewDecoder(data).Decode(&us)
if us.Limit == 0 {
us.Limit = USER_SEARCH_DEFAULT_LIMIT
}
return us
return &us
}
// UserSearchOptions captures internal parameters derived from the user's permissions and a