From e18b11a5fe1fa25b7f73f6526b2951187af0968b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 23 Apr 2023 01:35:00 +0200 Subject: [PATCH] Don't crash when the class isn't bold --- src/timetable.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/timetable.rs b/src/timetable.rs index 181ccad..05bc6a7 100644 --- a/src/timetable.rs +++ b/src/timetable.rs @@ -85,14 +85,11 @@ pub async fn timetable( } None => None, }, - room: capitalize( - &mut course - .select(&sel_strong) - .next() - .unwrap() - .inner_html() - .replace("
", ""), - ), + room: capitalize(&mut match course.select(&sel_strong).next() { + Some(el) => el.inner_html().replace("
", ""), + // Error in the site, silently passing... (the room is probably at the professor member) + None => String::new(), + }), start: location_tracker, size: match course.value().attr("colspan") { Some(i) => i.parse().unwrap(),