diff --git a/packages/ecs/include/ecs/entityecs/ECSExt.h b/packages/ecs/include/ecs/entityecs/ECSExt.h index 313a561..db9740c 100644 --- a/packages/ecs/include/ecs/entityecs/ECSExt.h +++ b/packages/ecs/include/ecs/entityecs/ECSExt.h @@ -361,7 +361,10 @@ namespace l::ecs { ComponentHandle getFirst() { ComponentViewCache* components = getComponentCache(); Entity* entity = components->getFirst(); - return entity->get(); + if (entity) { + return entity->get(); + } + return ComponentHandle(); } template