From b56d95f4faf6694eecf9f11cad2a62d446df96fc Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 21 Jun 2024 18:15:15 -0500 Subject: [PATCH] fix: skip empty --- app/ecs/ecs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ecs/ecs.js b/app/ecs/ecs.js index e8e08a0..47274a9 100644 --- a/app/ecs/ecs.js +++ b/app/ecs/ecs.js @@ -356,7 +356,9 @@ export default class Ecs { toJSON() { const 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 = []; for (const systemName in this.Systems) {