mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 05:07:05 +00:00
Fix compliments module bringing mirror to a halt (#3402)
... when no compliments are to be displayed. We shouldnt even try to randomize when the array has no elements... Fixes #3385
This commit is contained in:
@@ -50,7 +50,7 @@ Module.register("compliments", {
|
||||
* @returns {number} a random index of given array
|
||||
*/
|
||||
randomIndex (compliments) {
|
||||
if (compliments.length === 1) {
|
||||
if (compliments.length <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user