Skip to content

Commit 71613f5

Browse files
NaejDoreeJean Poree
authored andcommitted
fix(sdk): handle the null image case
1 parent f46a8a9 commit 71613f5

File tree

1 file changed

+5
-1
lines changed
  • engine/modules/entities/src/main/resources/view/entity-module

1 file changed

+5
-1
lines changed

engine/modules/entities/src/main/resources/view/entity-module/Sprite.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export class Sprite extends TextureBasedEntity {
2828
super.updateDisplay(state, changed, globalData)
2929
if (changed.image) {
3030
try {
31-
this.graphics.texture = PIXI.Texture.fromFrame(state.image)
31+
if (state.image !== null) {
32+
this.graphics.texture = PIXI.Texture.fromFrame(state.image)
33+
} else {
34+
this.graphics.texture = PIXI.Texture.EMPTY
35+
}
3236
} catch (error) {
3337
if (!this.missingTextures[state.image]) {
3438
this.missingTextures[state.image] = true

0 commit comments

Comments
 (0)