Secure type of HTMLImageElement in ImageTile

This commit is contained in:
Florent gravin
2018-09-18 14:57:59 +02:00
parent d062904cc1
commit e740e7577a

View File

@@ -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;