verify iterators in partialTopologicalSort to be on the safe side
currently this can cause a crash because issue 3214 is not fixed yet See also: https://forum.freecadweb.org/viewtopic.php?f=19&t=26295
This commit is contained in:
@@ -2303,7 +2303,8 @@ std::vector<App::DocumentObject*> DocumentP::partialTopologicalSort(const std::v
|
||||
|
||||
for (auto outListIt : out) {
|
||||
auto outListMapIt = countMap.find(outListIt);
|
||||
outListMapIt->second.first = outListMapIt->second.first - 1;
|
||||
if (outListMapIt != countMap.end())
|
||||
outListMapIt->second.first = outListMapIt->second.first - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2337,7 +2338,8 @@ std::vector<App::DocumentObject*> DocumentP::partialTopologicalSort(const std::v
|
||||
|
||||
for (auto inListIt : in) {
|
||||
auto inListMapIt = countMap.find(inListIt);
|
||||
inListMapIt->second.second = inListMapIt->second.second - 1;
|
||||
if (inListMapIt != countMap.end())
|
||||
inListMapIt->second.second = inListMapIt->second.second - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user