fixed coverity issue 17/301817/1
authorAdam Bialogonski <adam.b@samsung.com>
Thu, 23 Nov 2023 14:25:15 +0000 (14:25 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Thu, 23 Nov 2023 14:25:15 +0000 (14:25 +0000)
Change-Id: I14e7ced7fa0c1581454cafb46c404f191f163bd4

dali-scene3d/internal/model-components/model-node-impl.cpp

index d566163..6b2c8a2 100644 (file)
@@ -432,11 +432,15 @@ void ModelNode::SetColliderMesh(ColliderMeshUniquePtr&& colliderMesh)
   auto handle = Scene3D::ModelNode::DownCast(Self());
   if(mParentModel)
   {
-    if(mColliderMesh || colliderMesh == nullptr)
+    if(mColliderMesh)
     {
       mParentModel->RemoveColliderMesh(handle);
     }
-    mParentModel->RegisterColliderMesh(handle, *colliderMesh);
+
+    if(colliderMesh)
+    {
+      mParentModel->RegisterColliderMesh(handle, *colliderMesh);
+    }
   }
 
   mColliderMesh = std::move(colliderMesh);