From 9679dbb56c0c7836bf7b763e13010892fdf4a97e Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 17 May 2007 17:03:07 +0000 Subject: [PATCH] fix part two to #703 - dont try to erase a null geometry git-svn-id: http://svn.openlayers.org/trunk/openlayers@3155 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Vector.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 680fe1bb2a..af593bd8f3 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -246,8 +246,10 @@ OpenLayers.Layer.Vector.prototype = var feature = features[i]; this.features = OpenLayers.Util.removeItem(this.features, feature); - this.renderer.eraseGeometry(feature.geometry); - + if (feature.geometry) { + this.renderer.eraseGeometry(feature.geometry); + } + //in the case that this feature is one of the selected features, // remove it from that array as well. if (OpenLayers.Util.indexOf(this.selectedFeatures, feature) != -1){