Skip to content

Commit

Permalink
Merge pull request #297 from NIAEFEUP/release/3.1.1
Browse files Browse the repository at this point in the history
fix: app crashing sometimes after refresh course unit hashes
  • Loading branch information
tomaspalma committed Sep 9, 2024
2 parents 5ca88d4 + 086c120 commit 5cb200a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ClassItem = ({ course_id, classInfo, displayed, checked, preview, onSelect
// retrieve class with the picked class id of the course option
const pickedClass = pickedCourse.classes.find(c => c.id === course_option.picked_class_id);

classes.push(pickedClass);
if (pickedClass) classes.push(pickedClass);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const getAllPickedSlots = (selected_courses: PickedCourses, option: Option) => {
if (!course.picked_class_id) return []
const courseInfo = selected_courses.find((selected_course) => selected_course.id === course.course_id)
const classInfo = courseInfo.classes.find((classInfo) => classInfo.id === course.picked_class_id)
if( !classInfo ) return [];
if (!classInfo) return [];
return classInfo.slots
})
}
Expand Down

0 comments on commit 5cb200a

Please sign in to comment.