From 88ac5a803c382abe65f757ceacda139f1691024f Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 22 Dec 2006 18:50:30 +0000 Subject: [PATCH] Followup to #449: Missed part of the commit, which protects against doing a checkImgURL on a tile which has been destroyed. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2092 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Image.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index 69246e0f60..56342744f3 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -143,9 +143,13 @@ OpenLayers.Tile.Image.prototype = * @private */ checkImgURL: function () { - var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src; - if (loaded != this.url) { - this.imgDiv.style.display = "none"; + // Sometimes our image will load after it has already been removed + // from the map, in which case this check is not needed. + if (this.layer) { + var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src; + if (loaded != this.url) { + this.imgDiv.style.display = "none"; + } } },