Skip to content

SweepLine.RightOfHyperbola throws null reference when Apex() returns null #59

Description

@g-timmerman-4dn

First of all, I'm very inexperienced in all the math logic being performed in the Triangle package. Our application uses the Triangle.NET package, and I've been tasked to investigate an error in the logic. It is not common for our application to fail as it has been running for years with different datasets being provided and calculated without problems.

We have pinpointed the problem occurring in the RightOfHyperbola function in the SweepLine class.

The fronttri.Apex() call returns a null value and the subsequent if-condition throws a null reference error on the rightvertex.
The orient: 1 seems to select the null value in the vertices collection.

Here is the object contents in question where the problem occurs.
Image

The code obviously didn't expect it to return null. Should the code handle null values more gracefully, or is there a problem upstream where a null value in the vertices is incorrect (or should the orient setting never refer to a null value in the vertices). I lack the knowledge to say something meaningful here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions