diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 594df35..99c899a 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -628,7 +628,10 @@ namespace DCFApixels.DragonECS { list.Clear(); var itemsCount = GetComponentsCount(entityID); - + if (itemsCount <= 0) + { + return; + } int poolIndex = entityID; uint bit; for (int chunkIndex = 0; chunkIndex < _entityComponentMaskLength; chunkIndex++) @@ -663,7 +666,10 @@ namespace DCFApixels.DragonECS { typeSet.Clear(); var itemsCount = GetComponentsCount(entityID); - + if(itemsCount <= 0) + { + return; + } int poolIndex = entityID; uint bit; for (int chunkIndex = 0; chunkIndex < _entityComponentMaskLength; chunkIndex++)