diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js index f9d528b9d9..4634ef2ad7 100644 --- a/lib/OpenLayers/Layer/WMS/Untiled.js +++ b/lib/OpenLayers/Layer/WMS/Untiled.js @@ -66,8 +66,10 @@ OpenLayers.Layer.WMS.Untiled.prototype = * */ destroy: function() { - this.tile.destroy(); - this.tile = null; + if (this.tile) { + this.tile.destroy(); + this.tile = null; + } OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments); },