BUG: Fix Slicer crash due to wrong value return in AddModel
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.