diff --git a/lib/editor/actions/editor.js b/lib/editor/actions/editor.js index aa1250b74..cd3c15c58 100644 --- a/lib/editor/actions/editor.js +++ b/lib/editor/actions/editor.js @@ -77,7 +77,7 @@ function getCloneProps (entityId: number, component: string, state: AppState) { patternId: newPatternId, shapeId: newShapeId, shapePoints: pattern.shapePoints.map(sp => ({...sp, shapeId: newShapeId})), - patternStopAreas: pattern.stopAreas.map(area => ({...area, patternId: newPatternId})), + patternStopAreas: pattern.stopAreas && pattern.stopAreas.map(area => ({...area, patternId: newPatternId})), patternLocations: pattern.patternLocations.map(pl => ({...pl, patternId: newPatternId})), patternStops: pattern.patternStops.map(ps => ({...ps, patternId: newPatternId})) } diff --git a/lib/editor/selectors/timetable.js b/lib/editor/selectors/timetable.js index 643a9b7a5..9b6b9c5a3 100644 --- a/lib/editor/selectors/timetable.js +++ b/lib/editor/selectors/timetable.js @@ -157,6 +157,7 @@ const isCellValueInvalid = ( tripIds: Array ): ?EditorValidationIssue => { const col = columns[colIndex] + const isFlexInvolved = columns.some(isFlexStopTime) if (isTimeFormat(col.type)) { // FIXME: This does not yet support validating frequency start/end times. @@ -176,7 +177,7 @@ const isCellValueInvalid = ( // Ensure value is increasing over previous value // Flexible stop times (because intra zonal trips are represented by a duplicate stop time) can // include the same start and end pickup times back to back and so must avoid this check. - const isInvalid = !isFlexStopTime(col) && val < previousValue + const isInvalid = !isFlexInvolved && val < previousValue return isInvalid ? { field: col.key,