diff --git a/controllers/courses.js b/controllers/courses.js index d2a8e3b0ea..91ab460b7b 100644 --- a/controllers/courses.js +++ b/controllers/courses.js @@ -47,7 +47,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 = {