Skip to content

BUG: Fix Slicer crash due to wrong value return in AddModel

Sam Horvath requested to merge github/fork/agirault/fix-crash-vtk-reader into master

Created by: agirault

In vtkSlicerModelsLogic::AddModel, if the call to the storageNode ReadData() failed, an error message was triggered and the node removed from the scene, but AddModel() was still returning a pointer to the modelNode, resulting in Slicer crashing.

The bug was encountered when loading a VTK Volume (DATASET set to STRUCTURED_POINTS) and not selecting the 'Volume' description, since the default description for the legacy VTK files is 'Model' in Slicer.

Merge request reports

Loading