fix when there the course's name isn't in <em>

This commit is contained in:
Mylloon 2022-08-17 14:23:51 +02:00
parent 5077d6cb38
commit ea9c271b2c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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("<br>").next().unwrap().to_string(),
},
professor: match course
.select(&sel_small)
.next()