[MM-27836] Fix possible panic when patching config (#15262)

* Fix possible panic when updating/patching config

* Remove un-needed check
Этот коммит содержится в:
Claudio Costa
2020-08-17 14:53:48 +02:00
коммит произвёл GitHub
родитель 095e5d788b
Коммит 58c6eabf95
2 изменённых файлов: 7 добавлений и 1 удалений

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

@@ -180,7 +180,7 @@ func patchConfig(c *Context, w http.ResponseWriter, r *http.Request) {
}
appCfg := c.App.Config()
if *appCfg.ServiceSettings.SiteURL != "" && *cfg.ServiceSettings.SiteURL == "" {
if *appCfg.ServiceSettings.SiteURL != "" && (cfg.ServiceSettings.SiteURL == nil || *cfg.ServiceSettings.SiteURL == "") {
c.Err = model.NewAppError("patchConfig", "api.config.update_config.clear_siteurl.app_error", nil, "", http.StatusBadRequest)
return
}