Fix crash on out-of-bound vector access (#22397)
This commit is contained in:
committed by
Chris Hennes
parent
62946c410d
commit
7fec747d90
@@ -8632,9 +8632,6 @@ void SketchObject::rebuildExternalGeometry(std::optional<ExternalToAdd> extToAdd
|
||||
auto SubElements = ExternalGeometry.getSubValues();
|
||||
assert(externalGeoRef.size() == Objects.size());
|
||||
auto keys = externalGeoRef;
|
||||
if (Types.size() != Objects.size()) {
|
||||
Types.resize(Objects.size(), 0);
|
||||
}
|
||||
|
||||
// re-check for any missing geometry element. The code here has a side
|
||||
// effect that the linked external geometry will continue to work even if
|
||||
@@ -8695,6 +8692,10 @@ void SketchObject::rebuildExternalGeometry(std::optional<ExternalToAdd> extToAdd
|
||||
BRepBuilderAPI_MakeFace mkFace(sketchPlane);
|
||||
TopoDS_Shape aProjFace = mkFace.Shape();
|
||||
|
||||
if (Types.size() != Objects.size()) {
|
||||
Types.resize(Objects.size(), 0);
|
||||
}
|
||||
|
||||
std::set<std::string> refSet;
|
||||
// We use a vector here to keep the order (roughly) the same as ExternalGeometry
|
||||
std::vector<std::vector<std::unique_ptr<Part::Geometry> > > newGeos;
|
||||
|
||||
Reference in New Issue
Block a user