From bbb5b45133883fe3dc81b031670814a423b4d071 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 16 Dec 2024 14:58:35 +0100 Subject: [PATCH] Part: Fix segmentation fault in Feature::getExportElementName Calling ShapeType() on a null shape is not allowed and causes a segmentation fault. So, check beforehand if the shape is not null. Fixes #18537 --- src/Mod/Part/App/PartFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index 65ae266de8..31a5c3f9b3 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -365,7 +365,7 @@ App::ElementNamePair Feature::getExportElementName(TopoShape shape, // find it by matching either planes for faces or lines for edges. auto searchShape = this->Shape.getShape(); // If we're still out at a Shell, Solid, CompSolid, or Compound drill in - while (searchShape.getShape().ShapeType() < TopAbs_FACE ) { + while (!searchShape.getShape().IsNull() && searchShape.getShape().ShapeType() < TopAbs_FACE ) { auto shapes = searchShape.getSubTopoShapes(); if ( shapes.empty() ) // No more subshapes, so don't continue break;