From 2c03fdf9e93aa2951777565dd8543c52534d2be9 Mon Sep 17 00:00:00 2001 From: Harald Scheirich <harald.scheirich@kitware.com> Date: Mon, 28 Jun 2021 09:28:57 -0400 Subject: [PATCH] BUG: use a direct check for light existance --- Source/Scene/imstkScene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Scene/imstkScene.cpp b/Source/Scene/imstkScene.cpp index 751faecd8..0a80c598a 100644 --- a/Source/Scene/imstkScene.cpp +++ b/Source/Scene/imstkScene.cpp @@ -357,7 +357,7 @@ Scene::getLight(const std::string& lightName) const void Scene::addLight(const std::string& name, std::shared_ptr<Light> newLight) { - if (this->getLight(name) != nullptr) + if (m_lightsMap.find(name) != m_lightsMap.cend()) { LOG(WARNING) << "Can not add light: '" << name << "' is already registered in this scene."; -- GitLab