From 5a176d7852ef5732353aef934ba2b20bcee4d326 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 2 Feb 2008 22:48:37 +0000 Subject: [PATCH] Explicitly check that we know who the parent is before removing child from parent. r=crschmidt (closes #1316) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5973 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 40dabc4a10..2236a185aa 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -1000,7 +1000,7 @@ OpenLayers.Map = OpenLayers.Class({ removeControl: function (control) { //make sure control is non-null and actually part of our map if ( (control) && (control == this.getControl(control.id)) ) { - if (!control.outsideViewport && control.div) { + if (control.div && (control.div.parentNode == this.viewPortDiv)) { this.viewPortDiv.removeChild(control.div); } OpenLayers.Util.removeItem(this.controls, control);