Skip to content

Commit

Permalink
The Texture Manager will now fail gracefully when a texture isn't cre…
Browse files Browse the repository at this point in the history
…ated 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
  • Loading branch information
photonstorm committed Jan 2, 2025
1 parent e44ac38 commit 354b573
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/textures/TextureManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 354b573

Please sign in to comment.