Secure type of HTMLImageElement in ImageTile
This commit is contained in:
+2
-1
@@ -114,7 +114,8 @@ class ImageTile extends Tile {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleImageLoad_() {
|
handleImageLoad_() {
|
||||||
if (this.image_.naturalWidth && this.image_.naturalHeight) {
|
if (this.image_ instanceof HTMLImageElement &&
|
||||||
|
this.image_.naturalWidth && this.image_.naturalHeight) {
|
||||||
this.state = TileState.LOADED;
|
this.state = TileState.LOADED;
|
||||||
} else {
|
} else {
|
||||||
this.state = TileState.EMPTY;
|
this.state = TileState.EMPTY;
|
||||||
|
|||||||
Reference in New Issue
Block a user