summaryrefslogtreecommitdiffstats
path: root/app/plugin_api.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-07-10 10:52:57 -0400
committerChristopher Speller <crspeller@gmail.com>2018-07-10 07:52:57 -0700
commit6daf82073de808a9c7f22fe8f75be815835362cc (patch)
treed823d6c7d1058c2b46ea55d65e6b750917b3c7b8 /app/plugin_api.go
parente3c26a0e89253fb626515831d8468050e6235d89 (diff)
downloadchat-6daf82073de808a9c7f22fe8f75be815835362cc.tar.gz
chat-6daf82073de808a9c7f22fe8f75be815835362cc.tar.bz2
chat-6daf82073de808a9c7f22fe8f75be815835362cc.zip
Don't panic if plugin manifest does not have settings (#9086)
Diffstat (limited to 'app/plugin_api.go')
-rw-r--r--app/plugin_api.go6
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