function TBasicPointSeries.GetNearestPoint can fail
Original Reporter info from Mantis: mbuckingham
-
Reporter name:
Original Reporter info from Mantis: mbuckingham
- Reporter name:
Description:
The function TBasicPointSeries.GetNearestPoint returns a boolean and the assumption my code makes is that TRUE means everything worked OK. However the function only checks if the number of points in the series is greater than zero.
It is possible for none of the points in the series to be with the radius specified but the function will still return TRUE and this then leads to an 'EListError'. The only way I have of checking for this is by testing if AResults.FDist is equal to MaxInt, but this requires knowledge of the internal working s of GetNearestPoint.
Additional information:
One possible fix is to set Result to FALSE at the start of the function. Then set Result to TRUE as the last line of the "for i := 0 to Count - 1" loop. The function will then only return TRUE once it has successfully found a point within the given radius.
Mantis conversion info:
- Mantis ID: 22854
- Version: 1.0.0
- Fixed in revision: 38617 (#fd49bc20)