sched: only splice out alarm, if it's present in alarms

master
Rob Pilling 2023-06-07 17:57:00 +01:00
parent 3aaff4b460
commit 508808cc3d
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ function showAlarm(alarm) {
} else {
let del = alarm.del === undefined ? settings.defaultDeleteExpiredTimers : alarm.del;
if (del) {
alarms.splice(alarmIndex, 1);
if (alarmIndex >= 0) alarms.splice(alarmIndex, 1);
} else {
if (alarm.date && alarm.rp) {
setNextRepeatDate(alarm);