diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 893920013..94a9f2ba6 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -903,8 +903,10 @@ class basic_view, exclude_t<>> : public basic_storage_view { using base_type = basic_storage_view; - basic_view(Get *value) noexcept - : base_type{value} { + void storage_if(Get *value) noexcept { + if(value != nullptr) { + storage(*value); + } } public: @@ -949,7 +951,8 @@ public: */ template>>> basic_view(const basic_view &other) noexcept - : basic_view{other.storage()} { + : base_type{} { + storage_if(other.storage()); } /**