diff --git a/lib/editor/components/timetable/CalendarSelect.js b/lib/editor/components/timetable/CalendarSelect.js index 73ff815ec..e2442da7c 100644 --- a/lib/editor/components/timetable/CalendarSelect.js +++ b/lib/editor/components/timetable/CalendarSelect.js @@ -104,7 +104,7 @@ export default class CalendarSelect extends Component { _getOptions = (): Array => { const {activePattern, calendars, exceptionBasedCalendars, tripCounts, trips} = this.props const patternId = activePattern && activePattern.patternId - let calendarOptions: Array = calendars && activePattern + const calendarBasedOptions: Array = calendars && activePattern ? calendars .map(calendar => ({ label: calendar.description || calendar.service_id, @@ -129,7 +129,7 @@ export default class CalendarSelect extends Component { })) // $FlowFixMe: we need two types of options - calendarOptions = calendarOptions.concat(exceptionBasedCalendarOptions) + const calendarOptions = calendarBasedOptions.concat(exceptionBasedCalendarOptions) return calendarOptions .sort((a, b) => {