fix: container guards

This commit is contained in:
cha0s 2019-04-19 19:48:35 -05:00
parent 0f244f13d8
commit eaf031257e

View File

@ -73,7 +73,9 @@ export class Visible extends decorate(Trait) {
const zIndex = this.entity.zIndex;
this._usingAutoZIndex = AUTO_ZINDEX === zIndex;
if (!this._usingAutoZIndex) {
this._container.zIndex = zIndex;
if (this._container) {
this._container.zIndex = zIndex;
}
}
}
@ -102,7 +104,9 @@ export class Visible extends decorate(Trait) {
}
this._container.position = this.entity.position;
if (this._usingAutoZIndex) {
this._container.zIndex = this.entity.y;
if (this._container) {
this._container.zIndex = this.entity.y;
}
}
}