From eec54b3920b2974922a103b4bb4d5246f4cdefe8 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 03 May 2017 21:50:43 +0000
Subject: [PATCH] Fix JS error during vehicle removal when no feature is selected

---
 map.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/map.js b/map.js
index 236dac3..f791391 100644
--- a/map.js
+++ b/map.js
@@ -209,7 +209,7 @@
 			if(vehicle.isDeleted) {
 				if(vehicle_feature) {
 					vehicles_source.removeFeature(vehicle_feature);
-					if(feature_clicked.getId() == vehicle_feature.getId()) {
+					if(feature_clicked && feature_clicked.getId() == vehicle_feature.getId()) {
 						featureClicked();
 					}
 				}

--
Gitblit v1.9.1