You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a possibility of Line.Segment.intersectionWith to fail, by trying to access a null object.
Current code:
intersectionWith: function(obj){if(!this.line.intersects(obj)){returnnull;}varP=this.line.intersectionWith(obj);return(this.contains(P) ? P : null);}
The problem exists with the value of 'P'. This can be returned as null. Thus when the last line is executed "this.contains(P)" the code will fail, as P is null.
Test Code:
a=Sylvester.Line.Segment.create([600,216],[200,216])b=Sylvester.Line.Segment.create([300,616],[200,216])a.intersectionWith(b)// returns a valid pointb.intersectionWith(a)// fails! TypeError: Cannot read property 'start' of null
The text was updated successfully, but these errors were encountered:
There is a possibility of Line.Segment.intersectionWith to fail, by trying to access a null object.
Current code:
The problem exists with the value of 'P'. This can be returned as null. Thus when the last line is executed "this.contains(P)" the code will fail, as P is null.
Test Code:
The text was updated successfully, but these errors were encountered: