From ea9c271b2c9b6e660b206b6bd9b96d2932ec616a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 17 Aug 2022 14:23:51 +0200 Subject: [PATCH] fix when there the course's name isn't in --- src/timetable.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/timetable.rs b/src/timetable.rs index e79c96a..ff84ea2 100644 --- a/src/timetable.rs +++ b/src/timetable.rs @@ -52,7 +52,10 @@ pub async fn timetable( location_tracker += 1; } else { courses_vec.push(Some(models::Course { - name: course.select(&sel_em).next().unwrap().inner_html(), + name: match course.select(&sel_em).next() { + Some(value) => value.inner_html(), + None => course.inner_html().split("
").next().unwrap().to_string(), + }, professor: match course .select(&sel_small) .next()