From: mbs Date: Wed, 11 Sep 2024 17:29:33 +0000 (+0100) Subject: [GITHUB #2] problem in export dialog - difference in STEP vs BREP X-Git-Tag: V9_14_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b6957d1436d25b1e8baa5bf0e11eac3f875c586;p=modules%2Fshaper.git [GITHUB #2] problem in export dialog - difference in STEP vs BREP When selecting a feature, the context is a Feature and not a Result. Therefore, the result pointer is NULL and causes a SIGSEGV on Linux. On Windows, the exception is caught in Model_Update::executeFeature(). --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index 651b1b401..a02cf6809 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -142,9 +142,12 @@ bool STEPExport(const std::string& theFileName, getAttributes(*aResult, anAttrs); exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab); } - else { // whole result selection + else if (aResult->get()) { // whole result selection putResult(*aResult, GeomShapePtr(), aNullLab, anAttrs); } + else { // feature selection => export simple shape + exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab); + } } // store the XCAF document to STEP file try {