fix: support classes with no location (#242)
This commit is contained in:
@@ -72,10 +72,12 @@ export class CourseSchedule {
|
|||||||
days,
|
days,
|
||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
location: {
|
location: location[0]
|
||||||
building: location[0] ?? '',
|
? {
|
||||||
|
building: location[0],
|
||||||
room: location[1] ?? '',
|
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}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user