Fix crash possibility if module: <name> is not defined and on mistake position: <position> (#3445)

Fix #3442
This commit is contained in:
Bugsounet - Cédric
2024-06-24 21:51:54 +02:00
committed by GitHub
parent 4c748a4d32
commit e95c144c3e
8 changed files with 170 additions and 21 deletions

View File

@@ -50,7 +50,8 @@ const Loader = (function () {
* @returns {object[]} module data as configured in config
*/
const getAllModules = function () {
return config.modules;
const AllModules = config.modules.filter((module) => (module.module !== undefined) && (MM.getAvailableModulePositions.indexOf(module.position) > -1 || typeof (module.position) === "undefined"));
return AllModules;
};
/**