diff --git a/src/imagetilesource.js b/src/imagetilesource.js index cbea1ef0..6d49bbd3 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -272,8 +272,10 @@ */ _freeupCanvasMemory: function () { for (var i = 0; i < this.levels.length; i++) { - this.levels[i].context2D.canvas.height = 0; - this.levels[i].context2D.canvas.width = 0; + if(this.levels[i].context2D){ + this.levels[i].context2D.canvas.height = 0; + this.levels[i].context2D.canvas.width = 0; + } } }, });