Fix STL to Godot type convertion of polypartition

(cherry picked from commit d16bef8b55)
This commit is contained in:
Haoyu Qiu 2021-05-21 17:12:13 +08:00 committed by Rémi Verschelde
parent a26bed52c0
commit cf47129f9a
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1166,7 +1166,7 @@ int TriangulatorPartition::MonotonePartition(List<TriangulatorPoly> *inpolys, Li
newedge.p1 = v->p; newedge.p1 = v->p;
newedge.p2 = v->p; newedge.p2 = v->p;
edgeIter = edgeTree.lower_bound(newedge); edgeIter = edgeTree.lower_bound(newedge);
if(edgeIter == edgeTree.front()) { if(edgeIter == nullptr || edgeIter == edgeTree.front()) {
error = true; error = true;
break; break;
} }
@ -1202,7 +1202,7 @@ int TriangulatorPartition::MonotonePartition(List<TriangulatorPoly> *inpolys, Li
newedge.p1 = v->p; newedge.p1 = v->p;
newedge.p2 = v->p; newedge.p2 = v->p;
edgeIter = edgeTree.lower_bound(newedge); edgeIter = edgeTree.lower_bound(newedge);
if(edgeIter == edgeTree.front()) { if(edgeIter == nullptr || edgeIter == edgeTree.front()) {
error = true; error = true;
break; break;
} }
@ -1241,7 +1241,7 @@ int TriangulatorPartition::MonotonePartition(List<TriangulatorPoly> *inpolys, Li
newedge.p1 = v->p; newedge.p1 = v->p;
newedge.p2 = v->p; newedge.p2 = v->p;
edgeIter = edgeTree.lower_bound(newedge); edgeIter = edgeTree.lower_bound(newedge);
if(edgeIter == edgeTree.front()) { if(edgeIter == nullptr || edgeIter == edgeTree.front()) {
error = true; error = true;
break; break;
} }