diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index b2c317e4e1..9ce8b2bf90 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -151,7 +151,6 @@ OpenLayers.Map.prototype = { * @param {OpenLayers.Popup} popup */ addPopup: function(popup) { - popup.parent = this.viewPortDiv; this.popups.push(popup); var popupDiv = popup.draw(); if (popupDiv) { @@ -166,9 +165,11 @@ OpenLayers.Map.prototype = { */ removePopup: function(popup) { this.popups.remove(popup); - this.viewPortDiv.removeChild(popup.div); + if (popup.div) { + this.viewPortDiv.removeChild(popup.div); + } }, - + /** * @return {float} */