← All bug reports

FS#2256Getting the end direction of a zero-length polyline leads to AppCrash

Type
Bug
Status
Closed
Resolution
Fixed
Category
ECMAScript
Severity
Low
Priority
Low
Reported version
3.26.2
Operating system
Windows 7
Reported
2021-07-03 by CVH
Closed
2021-07-09 by andrew

Andrew,

With an RPolyline shape.
That is trimmed by RPolyline.trimEndPoint(cutPoint1, RVector.invalid, false);
And what is turned into a null-shape having only one single vertex.
Getting the end orientation of such a shape lead to an Application Crach.

RPolyline.getDirection1(); Doesn't fail and returns 0.0rad.
RPolyline.getDirection2(); Fails critical.

I would have expected 0.0rad or 'undefined' for both.

One can circumvent that with simply testing the nature of the RPolyline before getting the end direction, and this each time required.

Regards,
CVH