diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 767da1814..cee38e2e7 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -332,7 +332,10 @@ public: */ template void prepare(Args &&... args) { - ENTT_ASSERT(std::none_of(pools.cbegin(), pools.cend(), [ctype = to_integer(type())](auto &&pdata) {return pdata.runtime_type == ctype; })); + ENTT_ASSERT(std::none_of(pools.cbegin(), pools.cend(), [ctype = to_integer(type())](auto &&pdata) { + return pdata.pool && pdata.runtime_type == ctype; + })); + [[maybe_unused]] auto *cpool = assure(std::forward(args)...); ENTT_ASSERT(cpool->size() == 0); }