Fix possible panic during plugin installation (#15689)

Этот коммит содержится в:
Claudio Costa
2020-10-02 09:25:50 +02:00
коммит произвёл GitHub
родитель 6d7c5c5bf3
Коммит 51d790300f
2 изменённых файлов: 38 добавлений и 0 удалений

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

@@ -376,6 +376,8 @@ func (a *App) installExtractedPlugin(manifest *model.Manifest, fromPluginDir str
updatedManifest, _, err := pluginsEnvironment.Activate(manifest.Id)
if err != nil {
return nil, model.NewAppError("installExtractedPlugin", "app.plugin.restart.app_error", nil, err.Error(), http.StatusInternalServerError)
} else if updatedManifest == nil {
return nil, model.NewAppError("installExtractedPlugin", "app.plugin.restart.app_error", nil, "failed to activate plugin: plugin already active", http.StatusInternalServerError)
}
manifest = updatedManifest
}