Skip to content

Commit

Permalink
The method TextureManager.checkKey will now return false if the k…
Browse files Browse the repository at this point in the history
…ey is not a string, which fixes issues where a texture could be created if a key was given that was already in use
  • Loading branch information
photonstorm committed May 15, 2024
1 parent 946e82b commit 9b49655
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/textures/TextureManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var TextureManager = new Class({
*/
checkKey: function (key)
{
if (this.exists(key))
if (!key || typeof key !== 'string' || this.exists(key))
{
if (!this.silentWarnings)
{
Expand Down Expand Up @@ -473,7 +473,7 @@ var TextureManager = new Class({
* This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites.
*
* This is a WebGL only feature.
*
*
* Prior to Phaser 3.80.0, this method took a bare `WebGLTexture`
* as the `glTexture` parameter. You must now wrap the `WebGLTexture` in a
* `WebGLTextureWrapper` instance before passing it to this method.
Expand Down Expand Up @@ -1166,12 +1166,12 @@ var TextureManager = new Class({

/**
* Creates a texture from an array of colour data.
*
*
* This is only available in WebGL mode.
*
*
* If the dimensions provided are powers of two, the resulting texture
* will be automatically set to wrap by the WebGL Renderer.
*
*
* @method Phaser.Textures.TextureManager#addUint8Array
* @fires Phaser.Textures.Events#ADD
* @since 3.80.0
Expand Down

0 comments on commit 9b49655

Please sign in to comment.