Skip to content

Commit

Permalink
fixed IndexError
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasJoKuJonas committed Sep 12, 2024
1 parent 10f3e5b commit 3ea8fb5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/webuntis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,12 @@ def check_lesson(self, lesson, ignor_cancelled=False) -> bool:
if lesson.code == "cancelled" and not ignor_cancelled:
return False

if not getattr(lesson, "subjects", None) and not self.invalid_subjects:
return False
if not self.invalid_subjects:
try:
if not lesson.subjects:
return False
except IndexError:
return False

for filter_description in self.filter_description:
if (
Expand Down

0 comments on commit 3ea8fb5

Please sign in to comment.