[MM-51330] - Sentry Crash: nil pointer dereference in getSelfHostedProducts (#22569)

* [MM-51330] - Sentry Crash: nil pointer dereference in getSelfHostedProducts

* feedback impl

* fix bool

* remove double check

* fix failing tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Allan Guwatudde
2023-03-29 18:11:45 +03:00
коммит произвёл GitHub
родитель c78d6d47ac
Коммит c70d85c9bc
3 изменённых файлов: 122 добавлений и 7 удалений

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

@@ -39,9 +39,8 @@ func (api *API) InitHostedCustomer() {
}
func ensureSelfHostedAdmin(c *Context, where string) {
cloud := c.App.Cloud()
if cloud == nil {
c.Err = model.NewAppError(where, "api.server.cws.needs_enterprise_edition", nil, "", http.StatusBadRequest)
ensured := ensureCloudInterface(c, where)
if !ensured {
return
}