From d401c88a0437164cdbc594710ac46fa1c2dfc8d8 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 19 Apr 2023 11:54:45 +0200 Subject: [PATCH] view: assert on null handles --- src/entt/entity/view.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 572bc17ca..8136d48b9 100644 --- a/src/entt/entity/view.hpp +++ b/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; }