mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Fix crash possibility if module: <name>
is not defined and on mistake position: <position>
(#3445)
Fix #3442
This commit is contained in:
committed by
GitHub
parent
4c748a4d32
commit
e95c144c3e
11
js/utils.js
11
js/utils.js
@@ -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;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user