The TextureSource.setFilter method will now check to see if renderer is defined before accessing its gl property. This avoids Phaser crashing if you're in headless mode and set anti-aliasing to false in the game config. Fix #6663

This commit is contained in:
Richard Davey 2023-11-08 18:48:36 +00:00
parent 843c1454af
commit 6f801eeac7

View file

@ -281,7 +281,7 @@ var TextureSource = new Class({
*/ */
setFilter: function (filterMode) setFilter: function (filterMode)
{ {
if (this.renderer.gl) if (this.renderer && this.renderer.gl)
{ {
this.renderer.setTextureFilter(this.glTexture, filterMode); this.renderer.setTextureFilter(this.glTexture, filterMode);
} }