From 84177919da8278a73e0876e1048cf3c42807bcab Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 6 May 2024 18:57:52 +0200 Subject: [PATCH] Dont index into empty map --- mirror/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mirror/init.lua b/mirror/init.lua index e10d9de..05b63c8 100644 --- a/mirror/init.lua +++ b/mirror/init.lua @@ -318,7 +318,11 @@ end local function get(componentIndex: { [i24]: ArchetypeMap }, record: Record, componentId: i24) local archetype = record.archetype - local archetypeRecord = componentIndex[componentId].sparse[archetype.id] + local archetypesMap = componentIndex[componentId] + if not archetypesMap then + return nil + end + local archetypeRecord = archetypesMap[archetype.id] if not archetypeRecord then return nil