From 354b573e064972ae92afc140ce163a84dfd29459 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 2 Jan 2025 14:43:45 +0000 Subject: [PATCH] The Texture Manager will now fail gracefully when a texture isn't created as a result of calling the `addBase64` method. Rather than the error "TypeError: null is not an object (evaluating 'texture.source')" is will not return early --- src/textures/TextureManager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index 9f01412e7b..8bc628d0e9 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -366,6 +366,11 @@ var TextureManager = new Class({ { var texture = _this.create(key, image); + if (!texture) + { + return; + } + Parser.Image(texture, 0); _this.emit(Events.ADD, key, texture);