From 25ddf5946b9e0e5412e6e0db5f0b6be264b59a72 Mon Sep 17 00:00:00 2001 From: Zog Date: Thu, 11 Jan 2018 11:30:04 +0100 Subject: Refs #5544; Fix bug preventing VJ creation When the company has not been set --- app/javascript/vehicle_journeys/components/tools/CreateModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/vehicle_journeys/components/tools/CreateModal.js b/app/javascript/vehicle_journeys/components/tools/CreateModal.js index 9ab87af3f..07c684760 100644 --- a/app/javascript/vehicle_journeys/components/tools/CreateModal.js +++ b/app/javascript/vehicle_journeys/components/tools/CreateModal.js @@ -11,7 +11,7 @@ export default class CreateModal extends Component { handleSubmit() { if (actions.validateFields(...this.refs, $('.vjCreateSelectJP')[0]) && this.props.modal.modalProps.selectedJPModal) { - this.props.onAddVehicleJourney(this.refs, this.props.modal.modalProps.selectedJPModal, this.props.stopPointsList, this.props.modal.modalProps.vehicleJourney.company) + this.props.onAddVehicleJourney(this.refs, this.props.modal.modalProps.selectedJPModal, this.props.stopPointsList, this.props.modal.modalProps.vehicleJourney && this.props.modal.modalProps.vehicleJourney.company) this.props.onModalClose() $('#NewVehicleJourneyModal').modal('hide') } -- cgit v1.2.3