From e740e7577a70ee3eb0f090e1816ffdda76e5e722 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Tue, 18 Sep 2018 14:57:59 +0200 Subject: [PATCH] Secure type of HTMLImageElement in ImageTile --- src/ol/ImageTile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/ImageTile.js b/src/ol/ImageTile.js index dcf604787c..bb172b07e6 100644 --- a/src/ol/ImageTile.js +++ b/src/ol/ImageTile.js @@ -114,7 +114,8 @@ class ImageTile extends Tile { * @private */ handleImageLoad_() { - if (this.image_.naturalWidth && this.image_.naturalHeight) { + if (this.image_ instanceof HTMLImageElement && + this.image_.naturalWidth && this.image_.naturalHeight) { this.state = TileState.LOADED; } else { this.state = TileState.EMPTY;