fix: skip empty

This commit is contained in:
cha0s 2024-06-21 18:15:15 -05:00
parent 51a3576bca
commit b56d95f4fa

View File

@ -356,7 +356,9 @@ export default class Ecs {
toJSON() { toJSON() {
const entities = {}; const entities = {};
for (const id in this.$$entities) { for (const id in this.$$entities) {
entities[id] = this.$$entities[id].toJSON(); if (this.$$entities[id]) {
entities[id] = this.$$entities[id].toJSON();
}
} }
const systems = []; const systems = [];
for (const systemName in this.Systems) { for (const systemName in this.Systems) {