Commit f14c87ef authored by Yohann Bearzi's avatar Yohann Bearzi
Browse files

Fix vtkPointLocator::FindClosestInsertedPoint when no points are present

This method is supposed to return -1 as an index when it fails to find a
closest point. It was returning 0 instead when the internal point array
was empty
parent 0c29a7a2
......@@ -1346,7 +1346,7 @@ vtkIdType vtkPointLocator::FindClosestInsertedPoint(const double x[3])
// points in this bucket, search 1st level neighbors, and so on,
// until closest point found.
//
for (closest = 0, minDist2 = VTK_DOUBLE_MAX, level = 0; (closest == 0) &&
for (closest = -1, minDist2 = VTK_DOUBLE_MAX, level = 0; (closest == -1) &&
(level < this->Divisions[0] || level < this->Divisions[1] || level < this->Divisions[2]);
level++)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment