Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit 00f6fbe

Browse files
wwmayerchennes
authored andcommitted
PD: Fix possible crash in up to shape
1 parent e7e4103 commit 00f6fbe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Mod/PartDesign/App/FeatureExtrude.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ TopoShape FeatureExtrude::makeShellFromUpToShape(TopoShape shape, TopoShape sket
141141
dir = -dir;
142142
cfaces = Part::findAllFacesCutBy(shape, sketchshape, dir);
143143
}
144-
struct Part::cutTopoShapeFaces *nearFace;
145-
struct Part::cutTopoShapeFaces *farFace;
144+
145+
if (cfaces.empty()) {
146+
return shape;
147+
}
148+
149+
struct Part::cutTopoShapeFaces *nearFace {};
150+
struct Part::cutTopoShapeFaces *farFace {};
146151
nearFace = farFace = &cfaces.front();
147152
for (auto &face : cfaces) {
148153
if (face.distsq > farFace->distsq) {

0 commit comments

Comments
 (0)