Sketcher: fix seg-fault on loading sketch with redundant constraints

This commit is contained in:
jffmichi
2025-01-24 02:02:34 +01:00
committed by Chris Hennes
parent da43cb842b
commit ab311f1f9b

View File

@@ -5751,12 +5751,12 @@ void System::identifyConflictingRedundantConstraints(
std::vector<std::vector<Constraint*>> conflictGroupsOrig = conflictGroups;
conflictGroups.clear();
for (int i = conflictGroupsOrig.size() - 1; i >= 0; i--) {
auto iterRedundantEntry = std::find_if(conflictGroups[i].begin(),
conflictGroups[i].end(),
auto iterRedundantEntry = std::find_if(conflictGroupsOrig[i].begin(),
conflictGroupsOrig[i].end(),
[this](const auto item) {
return (this->redundant.count(item) > 0);
});
bool hasRedundant = (iterRedundantEntry != conflictGroups[i].end());
bool hasRedundant = (iterRedundantEntry != conflictGroupsOrig[i].end());
if (!hasRedundant) {
conflictGroups.push_back(conflictGroupsOrig[i]);
continue;