Skip to content

Commit

Permalink
BC-5477 - Add optional chaining operator to course.times (#3330)
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax authored Oct 11, 2023
1 parent f768a37 commit c727d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const createEventsForCourse = (req, res, course) => {
// can just run if a calendar service is running on the environment
if (Configuration.get('CALENDAR_SERVICE_ENABLED') === true) {
return Promise.all(
course.times.map((time) => {
course.times?.map((time) => {
const startDate = timesHelper.fromUTC(course.startDate).add(time.startTime, 'ms');
const repeatUntil = timesHelper.fromUTC(course.untilDate);
const event = {
Expand Down

0 comments on commit c727d25

Please sign in to comment.