mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Dont index into empty map
This commit is contained in:
parent
015e5c0550
commit
84177919da
1 changed files with 5 additions and 1 deletions
|
@ -318,7 +318,11 @@ end
|
||||||
|
|
||||||
local function get(componentIndex: { [i24]: ArchetypeMap }, record: Record, componentId: i24)
|
local function get(componentIndex: { [i24]: ArchetypeMap }, record: Record, componentId: i24)
|
||||||
local archetype = record.archetype
|
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
|
if not archetypeRecord then
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue