From 4ab23caf0088d578ff41913ecda65b39a587b1dc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 16 Aug 2022 14:06:58 +0200 Subject: [PATCH] add desc only if available --- src/ics.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ics.rs b/src/ics.rs index 5792f7c..da3c140 100644 --- a/src/ics.rs +++ b/src/ics.rs @@ -15,7 +15,9 @@ pub fn export(courses: Vec, filename: &str) { // Consume actual time event.push(Transp::opaque()); // Professor's name - event.push(Description::new(course.professor.unwrap_or_default())); + if course.professor.is_some() { + event.push(Description::new(course.professor.unwrap())); + } // Start time of the course event.push(DtStart::new(dt_ical(course.dtstart.unwrap()))); // End time of the course