diff --git a/edupage_api/classes.py b/edupage_api/classes.py index a1e991d..6dbe718 100644 --- a/edupage_api/classes.py +++ b/edupage_api/classes.py @@ -59,7 +59,7 @@ def get_classes(self) -> Optional[list]: def get_class(self, class_id: int | str) -> Optional[Class]: try: class_id = int(class_id) - except ValueError: + except (ValueError, TypeError): return None return next( diff --git a/edupage_api/classrooms.py b/edupage_api/classrooms.py index 37a5d58..33f591e 100644 --- a/edupage_api/classrooms.py +++ b/edupage_api/classrooms.py @@ -39,7 +39,7 @@ def get_classrooms(self) -> Optional[list]: def get_classroom(self, classroom_id: int | str) -> Optional[Classroom]: try: classroom_id = int(classroom_id) - except ValueError: + except (ValueError, TypeError): return None return next( diff --git a/edupage_api/people.py b/edupage_api/people.py index f119981..00b8497 100644 --- a/edupage_api/people.py +++ b/edupage_api/people.py @@ -218,7 +218,7 @@ def get_all_students(self) -> Optional[list[EduStudent]]: def get_teacher(self, teacher_id: int | str) -> Optional[EduTeacher]: try: teacher_id = int(teacher_id) - except ValueError: + except (ValueError, TypeError): return None return next( @@ -234,7 +234,7 @@ def get_teacher(self, teacher_id: int | str) -> Optional[EduTeacher]: def get_student(self, student_id: int | str) -> Optional[EduStudent]: try: student_id = int(student_id) - except ValueError: + except (ValueError, TypeError): return None return next( diff --git a/edupage_api/subjects.py b/edupage_api/subjects.py index 34e3861..0c14516 100644 --- a/edupage_api/subjects.py +++ b/edupage_api/subjects.py @@ -39,7 +39,7 @@ def get_subjects(self) -> Optional[list]: def get_subject(self, subject_id: int | str) -> Optional[Subject]: try: subject_id = int(subject_id) - except ValueError: + except (ValueError, TypeError): return None return next(