From a68492e003342de861b8eab33bff48fabd80670e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 25 Jan 2008 23:18:20 +0000 Subject: [PATCH] The deactivate method of the modify feature control calls the unselect method of its select feature control and passes it the current selected feature (if any). If that selected feature is destroyed between the time it was selected and the time the modify feature control is deactivated, the unselect method of the select feature control will attempt to draw it on the layer while it no longer has a geometry (it's destroyed!). This patch prevents this from happening. Thanks to tlpinney for reporting the bug and helping on its evaluation. r=tschaub (closes #1281) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5897 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/ModifyFeature.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index a1b1244484..8b381420f6 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -261,7 +261,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { this.layer.removeFeatures(this.virtualVertices); this.vertices = []; this.dragControl.deactivate(); - if(this.feature) { + if(this.feature && this.feature.geometry) { this.selectControl.unselect.apply(this.selectControl, [this.feature]); }