From 3ea8fb58aa0a255d5bea5da27c09474a66af8927 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 12 Sep 2024 12:13:35 +0200 Subject: [PATCH] fixed IndexError --- custom_components/webuntis/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/custom_components/webuntis/__init__.py b/custom_components/webuntis/__init__.py index 81d9c6d..7766306 100644 --- a/custom_components/webuntis/__init__.py +++ b/custom_components/webuntis/__init__.py @@ -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 (