fix: support classes with no location (#242)

This commit is contained in:
Samuel Gunter
2024-09-30 22:43:09 -05:00
committed by GitHub
parent e2cbfa3f48
commit 3ff06e043b

View File

@@ -72,10 +72,12 @@ export class CourseSchedule {
days, days,
startTime, startTime,
endTime, endTime,
location: { location: location[0]
building: location[0] ?? '', ? {
room: location[1] ?? '', building: location[0],
}, room: location[1] ?? '',
}
: undefined,
} satisfies Serialized<CourseMeeting>); } satisfies Serialized<CourseMeeting>);
} catch (e) { } catch (e) {
throw new Error(`Failed to parse schedule: ${dayLine} ${timeLine} ${locLine}`); throw new Error(`Failed to parse schedule: ${dayLine} ${timeLine} ${locLine}`);