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:
Veeck
2024-03-23 12:16:57 +01:00
committed by GitHub
parent 52cfbacd4d
commit 57549fa19c
2 changed files with 6 additions and 5 deletions

View File

@@ -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;
}