Crashed attempting to access non-existing element. Fixes #1258

master
Marius Kintel 2015-03-13 15:45:40 -04:00
parent f3e28ca8b4
commit 4a9d2d321a
1 changed files with 1 additions and 1 deletions

View File

@ -1180,7 +1180,7 @@ namespace CGALUtils {
int idx = allVertices.lookup(vector_convert<Vector3f>(p));
if (currface.empty() || idx != currface.back()) currface.push_back(idx);
}
if (currface.front() == currface.back()) currface.pop_back();
if (!currface.empty() && currface.front() == currface.back()) currface.pop_back();
if (currface.size() < 3) faces.pop_back(); // Cull empty triangles
}
}