diff --git a/src/globals/validate.js b/src/globals/validate.js index 06d18370cb..2b7048c882 100644 --- a/src/globals/validate.js +++ b/src/globals/validate.js @@ -1,12 +1,14 @@ const { MissingGlobalLabel, DuplicateGlobalLabel } = require('../errors'); module.exports = function validateGlobal(globalConfigs, Globals) { - Object.values(globalConfigs).forEach((config) => { - if (!config.label) { - throw new MissingGlobalLabel(config); - } - if (Globals && Globals[config.label]) { - throw new DuplicateGlobalLabel(config); - } - }); + if (globalConfigs) { + Object.values(globalConfigs).forEach((config) => { + if (!config.label) { + throw new MissingGlobalLabel(config); + } + if (Globals && Globals[config.label]) { + throw new DuplicateGlobalLabel(config); + } + }); + } };