From 00502657f4db386e1307b45b6bc0d2ceb808cfc3 Mon Sep 17 00:00:00 2001 From: knownotunknown <78577376+knownotunknown@users.noreply.github.com> Date: Sun, 10 Mar 2024 23:49:01 -0500 Subject: [PATCH] refactor: doesn't crash tab, and doesn't cause errors --- src/shared/types/CourseSchedule.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/types/CourseSchedule.ts b/src/shared/types/CourseSchedule.ts index 1b3c1afb..9b780a7b 100644 --- a/src/shared/types/CourseSchedule.ts +++ b/src/shared/types/CourseSchedule.ts @@ -10,14 +10,16 @@ export class CourseSchedule { meetings: CourseMeeting[]; constructor(courseSchedule?: Serialized) { + this.meetings = []; if (!courseSchedule) { return; } Object.assign(this, courseSchedule); - this.meetings = []; + let newMeetings = []; for (let meeting of courseSchedule.meetings) { - this.meetings.push(new CourseMeeting(meeting)); + newMeetings.push(new CourseMeeting(meeting)); } + this.meetings = newMeetings; } /**