From 7fe89bdc0b8ad57056d39234eed11d001bf2a0e8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 14 Aug 2025 17:18:04 +0200 Subject: [PATCH] Part: Fix crash in MultiFuse::execute() The processed shape is null and thus it's not allowed to call its ShapeType() method. The crash is not directly related to the fact that there is a cyclic dependency Fixes https://github.com/FreeCAD/FreeCAD/issues/22879 --- src/Mod/Part/App/FeaturePartFuse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index efd7191bff..3c9ceb579f 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -103,7 +103,8 @@ App::DocumentObjectExecReturn *MultiFuse::execute() const int maxIterations = 1'000'000; // will trigger "not enough shape objects linked" error below if ever reached for (int i = 0; shapes.size() == 1 && i < maxIterations; ++i) { compoundOfArguments = shapes[0]; - if (compoundOfArguments.getShape().ShapeType() == TopAbs_COMPOUND) { + TopoDS_Shape shape = compoundOfArguments.getShape(); + if (!shape.IsNull() && shape.ShapeType() == TopAbs_COMPOUND) { shapes.clear(); shapes = compoundOfArguments.getSubTopoShapes(); argumentsAreInCompound = true;