فهرست منبع

view: assert on null handles

Michele Caini 3 سال پیش
والد
کامیت
d401c88a04
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/entt/entity/view.hpp

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

@@ -309,6 +309,7 @@ public:
      * @return The leading storage of the view.
      */
     [[nodiscard]] const common_type &handle() const noexcept {
+        ENTT_ASSERT(view != nullptr, "Handle not available");
         return *view;
     }
 
@@ -616,6 +617,7 @@ public:
      * @return The leading storage of the view.
      */
     [[nodiscard]] const common_type &handle() const noexcept {
+        ENTT_ASSERT(view != nullptr, "Handle not available");
         return *view;
     }