From 13e32eb8bf5d8a08583ffa8659a9c7f935076224 Mon Sep 17 00:00:00 2001 From: Zog Date: Thu, 28 Dec 2017 14:59:02 +0100 Subject: Refs #5407; Fix editor when the current organisation does not have the purchase_windows feature --- app/javascript/vehicle_journeys/actions/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/javascript/vehicle_journeys/actions/index.js b/app/javascript/vehicle_journeys/actions/index.js index 202c09440..a1a3ff68c 100644 --- a/app/javascript/vehicle_journeys/actions/index.js +++ b/app/javascript/vehicle_journeys/actions/index.js @@ -349,13 +349,15 @@ const actions = { color: tt.color }) } - for (tt of val.purchase_windows){ - purchaseWindows.push({ - objectid: tt.objectid, - name: tt.name, - id: tt.id, - color: tt.color - }) + if(val.purchase_windows){ + for (tt of val.purchase_windows){ + purchaseWindows.push({ + objectid: tt.objectid, + name: tt.name, + id: tt.id, + color: tt.color + }) + } } let vjasWithDelta = val.vehicle_journey_at_stops.map((vjas, i) => { actions.fillEmptyFields(vjas) -- cgit v1.2.3