From cd6488e8db8398296a10f00fa242eaf0214c29dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Lesquir?= Date: Sat, 19 Jan 2019 16:50:36 -0500 Subject: [PATCH] Headless tilesprite crash fix Fixes issue https://github.com/photonstorm/phaser/issues/4297 --- src/gameobjects/tilesprite/TileSprite.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index e76c515de..08e825136 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -420,7 +420,7 @@ var TileSprite = new Class({ var fw = this.potWidth; var fh = this.potHeight; - if (!this.renderer.gl) + if (!this.renderer || !this.renderer.gl) { fw = frame.cutWidth; fh = frame.cutHeight; @@ -439,7 +439,7 @@ var TileSprite = new Class({ fw, fh ); - if (this.renderer.gl) + if (this.renderer && this.renderer.gl) { this.fillPattern = this.renderer.canvasToTexture(canvas, this.fillPattern); }