From 9dc5c4d69c4ba358955a810089787e64a4e34bfc Mon Sep 17 00:00:00 2001 From: Al Duncanson Date: Wed, 3 Oct 2018 16:41:09 -0400 Subject: [PATCH] added check for props --- src/pages/Map.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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