Explorar o código

registry: added missing assert (close #409)

Michele Caini %!s(int64=6) %!d(string=hai) anos
pai
achega
84d3f9ab9a
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/entt/entity/registry.hpp

+ 2 - 0
src/entt/entity/registry.hpp

@@ -937,6 +937,8 @@ public:
     /*! @copydoc try_get */
     template<typename... Component>
     auto try_get([[maybe_unused]] const entity_type entity) {
+        ENTT_ASSERT(valid(entity));
+
         if constexpr(sizeof...(Component) == 1) {
             return (assure<Component>().try_get(entity), ...);
         } else {