[alarms] Skip touch events on checkboxes of undefined alarms

Signed-off-by: k <k@klabz.org>
This commit is contained in:
k 2021-10-15 23:05:23 +02:00 committed by Daniel Thompson
parent bd91a1076d
commit 59c943d212

View file

@ -175,7 +175,7 @@ class AlarmApp:
self._remove_alarm(self.page)
elif self.page == _HOME_PAGE:
for index, checkbox in enumerate(self.alarm_checks):
if checkbox.touch(event):
if index < self.num_alarms and checkbox.touch(event):
if checkbox.state:
self.alarms[index][_ENABLED_IDX] |= _IS_ACTIVE
else: