Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix crash in vtkPointLocator when markups curve polydata is empty
In some situations (such as between Start/EndModify calls on vtkMRMLMarkupsCurveNode), it is possible that the output curve polydata will be in a state it has no points. If TransformedCurvePolyLocator had been previously initialized and FindClosestPoint is called when the curve polydata has no points, then it will cause a crash. This is due to the vtkPointLocator HashTable not being reset correctly. See related MR fixing the issue in VTK here: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11114 This commit fixes the crash by returning if there are no points without checking the vtkPointLocator. This change also serves as an minor optimization.
- Loading branch information