diff options
author | Joram Wilander <jwawilander@gmail.com> | 2018-07-10 10:52:57 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-07-10 07:52:57 -0700 |
commit | 6daf82073de808a9c7f22fe8f75be815835362cc (patch) | |
tree | d823d6c7d1058c2b46ea55d65e6b750917b3c7b8 | |
parent | e3c26a0e89253fb626515831d8468050e6235d89 (diff) | |
download | chat-6daf82073de808a9c7f22fe8f75be815835362cc.tar.gz chat-6daf82073de808a9c7f22fe8f75be815835362cc.tar.bz2 chat-6daf82073de808a9c7f22fe8f75be815835362cc.zip |
Don't panic if plugin manifest does not have settings (#9086)
-rw-r--r-- | app/plugin_api.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/plugin_api.go b/app/plugin_api.go index 279694c44..4130fc4b2 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -32,8 +32,10 @@ func (api *PluginAPI) LoadPluginConfiguration(dest interface{}) error { finalConfig := make(map[string]interface{}) // First set final config to defaults - for _, setting := range api.manifest.SettingsSchema.Settings { - finalConfig[strings.ToLower(setting.Key)] = setting.Default + if api.manifest.SettingsSchema != nil { + for _, setting := range api.manifest.SettingsSchema.Settings { + finalConfig[strings.ToLower(setting.Key)] = setting.Default + } } // If we have settings given we override the defaults with them |