Boolean: Prevent rare exception where an encountered segment is not part of a valid path anymore.

Relates to #1091
This commit is contained in:
Jürg Lehni 2016-07-14 09:14:11 +02:00
parent 80f4ba947f
commit 083a2c6e0d

View file

@ -527,7 +527,7 @@ PathItem.inject(new function() {
// are bringing us back to the beginning, and are both valid,
// meaning they are part of the boolean result.
if (seg !== exclude && (isStart(seg) || isStart(nextSeg)
|| !seg._visited && !nextSeg._visited
|| nextSeg && !seg._visited && !nextSeg._visited
// Self-intersections (!operator) don't need isValid() calls
&& (!operator || isValid(seg) && (isValid(nextSeg)
// If the next segment isn't valid, its intersection