Sfoglia il codice sorgente

Triangle value is null-error, I don't know why it happened.

copycd 1 anno fa
parent
commit
6bcdf989fb
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      contrib/poly2tri/poly2tri/sweep/sweep.cc

+ 3 - 0
contrib/poly2tri/poly2tri/sweep/sweep.cc

@@ -111,6 +111,9 @@ void Sweep::EdgeEvent(SweepContext& tcx, Edge* edge, Node* node)
 
 void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point)
 {
+  if (triangle == nullptr)
+   return;
+
   if (IsEdgeSideOfTriangle(*triangle, ep, eq)) {
     return;
   }