[MM-42339] api4/license: add a nil check to not panic if server is not EE dist (#19770)
* api4/license: add a nil check to not panic if server is not EE dist * add a test case
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
82c8bd33ed
Коммит
3cab0f1d8d
@@ -242,6 +242,11 @@ func requestRenewalLink(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if c.App.Cloud() == nil {
|
||||
c.Err = model.NewAppError("requestRenewalLink", "api.license.upgrade_needed.app_error", nil, "", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
// check if it is possible to renew license on the portal with generated token
|
||||
e := c.App.Cloud().GetLicenseRenewalStatus(c.AppContext.Session().UserId, token)
|
||||
if e != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user