Skip to content

Commit

Permalink
BUG: Fix Model DM crash when adding display node
Browse files Browse the repository at this point in the history
* Fix vtkMRMLModelDisplayableManager crash if added model display
  node doesn't derive from vtkMRMLModelDisplayNode
  • Loading branch information
Thibault-Pelletier authored and lassoan committed Jan 9, 2025
1 parent ab9ff4a commit 2e8989a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ void vtkMRMLModelDisplayableManager::UpdateModelMesh(vtkMRMLDisplayableNode* dis
}
}

if (hasMesh && ait == this->Internal->DisplayedActors.end())
if (hasMesh && modelDisplayNode && ait == this->Internal->DisplayedActors.end())
{
this->GetRenderer()->AddViewProp(prop);
this->Internal->DisplayedActors[modelDisplayNode->GetID()] = prop;
Expand All @@ -1033,7 +1033,7 @@ void vtkMRMLModelDisplayableManager::UpdateModelMesh(vtkMRMLDisplayableNode* dis
this->Internal->DisplayedClipState[modelDisplayNode->GetID()] = 0;
}
}
else
else if (modelDisplayNode)
{
if (clipper)
{
Expand All @@ -1045,7 +1045,7 @@ void vtkMRMLModelDisplayableManager::UpdateModelMesh(vtkMRMLDisplayableNode* dis
}
}

if (hasMesh && cait == this->Internal->DisplayedCapActors.end())
if (hasMesh && modelDisplayNode && cait == this->Internal->DisplayedCapActors.end())
{
this->GetRenderer()->AddViewProp(capProp);
this->Internal->DisplayedCapActors[modelDisplayNode->GetID()] = capProp;
Expand Down

0 comments on commit 2e8989a

Please sign in to comment.