@@ -683,7 +683,7 @@ public:
* @return True if the view is empty, false otherwise.
*/
[[nodiscard]] bool empty() const noexcept {
- return view->empty();
+ return !view || view->empty();
}
/**
@@ -77,6 +77,7 @@ TEST(SingleComponentView, InvalidView) {
ASSERT_FALSE(view);
ASSERT_EQ(view.size(), 0u);
+ ASSERT_TRUE(view.empty());
entt::storage<int> storage;
view.storage(storage);