diff options
| -rw-r--r-- | app/javascript/vehicle_journeys/actions/index.js | 16 | 
1 files 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) | 
