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

@@ -25,5 +25,16 @@ module.exports = {
} catch (e) {
Log.error(e);
}
},
// return all available module positions
getAvailableModulePositions () {
return ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"];
},
// return if postion is on modulePositions Array (true/false)
moduleHasValidPosition (position) {
if (this.getAvailableModulePositions().indexOf(position) === -1) return false;
return true;
}
};