diff --git a/src/pages/Map.js b/src/pages/Map.js index 806b961..d738508 100644 --- a/src/pages/Map.js +++ b/src/pages/Map.js @@ -73,7 +73,9 @@ export class MapContainer extends Component { let lat = e.latLng.lat(); let lng = e.latLng.lng(); - this.props.onClick(lat,lng); + if (this.props.onClick) { + this.props.onClick(lat,lng); + } } // Set the state of the component to contain user coordinates and initial