Salome HOME
#17336 [CEA 17333] Mesh offset generates a segmentation violation
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.cxx
index 12e01cd2adac78e1c810a8bb3c1b19d1bbafa2ab..d029fe5ca5a1df9aeb393334d36193c609fc74e2 100644 (file)
@@ -6367,7 +6367,7 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
  *  \param [in] theValue - offset value
  *  \param [out] theTgtMesh - a mesh to add offset elements to
  *  \param [in] theMakeGroups - to generate groups
- *  \return PGroupIDs - IDs of created groups
+ *  \return PGroupIDs - IDs of created groups. NULL means failure
  */
 //================================================================================
 
@@ -6454,6 +6454,8 @@ SMESH_MeshEditor::PGroupIDs SMESH_MeshEditor::Offset( TIDSortedElemSet & theElem
   PGroupIDs newGroupIDs;
   if ( theMakeGroups )
     newGroupIDs = generateGroups( srcNodes, srcElems, "offset", theTgtMesh, false );
+  else
+    newGroupIDs.reset( new std::list< int > );
 
   return newGroupIDs;
 }