Skip to content

Commit

Permalink
We shouldnt even try to randomize when the array has no elements
Browse files Browse the repository at this point in the history
  • Loading branch information
rejas committed Mar 22, 2024
1 parent 6de578e commit e8c7600
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ _This release is scheduled to be released on 2024-04-01._
- Ignore all custom css files (#3359)
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353)
- [calandar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382)
- [calendar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382)
- added message in case where config.js is missing the module.export line PR #3383
- Fixed an issue where recurring events could extend past their recurrence end date (#3393)
- Don't display any `npm WARN <....>` on install (#3399)
- Fixed move suncalc dependency to production from dev, as it is used by clock module
- [compliments] Fix mirror not responding anymore when no compliments are to be shown (#3385)

### Deleted

Expand Down Expand Up @@ -93,7 +94,7 @@ This release also marks the latest release by Michael Teeuw. For more info, plea
- Fix #3256 filter out bad results from rrule.between
- Fix calendar events sometimes not respecting deleted events (#3250)
- Fix electron loadurl locally on Windows when address "0.0.0.0" (#2550)
- Fix updatanotification (update_helper.js): catch error if reponse is not an JSON format (check PM2)
- Fix updatanotification (update_helper.js): catch error if response is not an JSON format (check PM2)
- Fix missing typeof in calendar module
- Fix style issues after prettier update
- Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday
Expand Down Expand Up @@ -168,8 +169,8 @@ Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not al
- Added tests for serveronly
- Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests)
- Added no-param-reassign eslint rule and fix warnings
- updatenotification: Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules
- updatenotification: allow force scanning with `SCAN_UPDATES` notification from other modules
- [updatenotification] Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules
- [updatenotification] Allow force scanning with `SCAN_UPDATES` notification from other modules
- Added per-calendar fetchInterval

### Removed
Expand Down
2 changes: 1 addition & 1 deletion modules/default/compliments/compliments.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e8c7600

Please sign in to comment.