Skip to content

Commit 34efa22

Browse files
committed
Small conditional check in case someone has removed the animations property.
1 parent 6a0b8b5 commit 34efa22

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/gameobjects/Sprite.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
392392
else
393393
{
394394
this.setTexture(new PIXI.Texture(PIXI.BaseTextureCache[key]));
395-
setFrame = !this.animations.loadFrameData(this.game.cache.getFrameData(key), frame);
395+
396+
if (this.animations)
397+
{
398+
setFrame = !this.animations.loadFrameData(this.game.cache.getFrameData(key), frame);
399+
}
396400
}
397401
}
398402

0 commit comments

Comments
 (0)