Fix panic in api4.searchPosts (#15410)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4c518055f4
Коммит
7612888052
@@ -466,7 +466,11 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
params := model.SearchParameterFromJson(r.Body)
|
||||
params, jsonErr := model.SearchParameterFromJson(r.Body)
|
||||
if jsonErr != nil {
|
||||
c.Err = model.NewAppError("searchPosts", "api.post.search_posts.invalid_body.app_error", nil, jsonErr.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
if params.Terms == nil || len(*params.Terms) == 0 {
|
||||
c.SetInvalidParam("terms")
|
||||
|
||||
Ссылка в новой задаче
Block a user