diff --git a/openVulkanoCpp/Scene/Node.cpp b/openVulkanoCpp/Scene/Node.cpp index 8bb41c2..1ceebf1 100644 --- a/openVulkanoCpp/Scene/Node.cpp +++ b/openVulkanoCpp/Scene/Node.cpp @@ -133,10 +133,13 @@ namespace OpenVulkano::Scene } for (auto& drawable : drawables) { - Scene* drawableScene = drawable->GetScene(); - if(drawableScene && drawableScene != scene) [[unlikely]] + if (scene) { - throw std::runtime_error("Drawable is already associated with a scene! Creating copy."); + Scene* drawableScene = drawable->GetScene(); + if(drawableScene && drawableScene != scene) [[unlikely]] + { + throw std::runtime_error("Drawable is already associated with a scene! Creating copy."); + } } drawable->SetScene(scene); }