Archived
1
0
Fork 0
forked from Anri/cal8tor

Don't crash when the class isn't bold

This commit is contained in:
Mylloon 2023-04-23 01:33:29 +02:00
parent 8c62c479d1
commit 1c20dbfc26
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -85,14 +85,11 @@ pub async fn timetable(
}
None => None,
},
room: capitalize(
&mut course
.select(&sel_strong)
.next()
.unwrap()
.inner_html()
.replace("<br>", ""),
),
room: capitalize(&mut match course.select(&sel_strong).next() {
Some(el) => el.inner_html().replace("<br>", ""),
// 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(),