mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
Don't panic if plugin manifest does not have settings (#9086)
This commit is contained in:
committed by
Christopher Speller
parent
e3c26a0e89
commit
6daf82073d
+4
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user