Addressing issue #1862 by filtering out Boolean values from the plugins list (#1927)

* Addressing issue #1862 by filtering out Boolean values from the plugins list in the config.

* Updating the PR based on review comments.
This commit is contained in:
nitsakh 2017-06-12 18:48:56 -07:00 committed by Albin Ekblom
parent 38db5095d9
commit 7b403380b0

View file

@ -36,6 +36,9 @@ const _init = function (cfg) {
notify('Error reading configuration: `config` key is missing');
return _extractDefault(cfg.defaultCfg);
}
// Ignore undefined values in plugin and localPlugins array Issue #1862
_cfg.plugins = (_cfg.plugins && _cfg.plugins.filter(Boolean)) || [];
_cfg.localPlugins = (_cfg.localPlugins && _cfg.localPlugins.filter(Boolean)) || [];
return _cfg;
}
return _extractDefault(cfg.defaultCfg);