Salome HOME
bos #30314 EDF 25565 - Strange behavior on a specific case
authoreap <eap@opencascade.com>
Fri, 17 Jun 2022 16:02:28 +0000 (19:02 +0300)
committereap <eap@opencascade.com>
Fri, 17 Jun 2022 16:02:28 +0000 (19:02 +0300)
Avoid SIGSEGV when returning NULL instead of an empty list

src/SMESH_I/SMESH_MeshEditor_i.cxx

index e87f092a24eedb24845e8929c5ed63f03f1f1def..71106151f476f1720fb9a89bbe9b0eccdc21e0f2 100644 (file)
@@ -3664,7 +3664,7 @@ SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::smIdType_array& theIDsOfEle
                 << theIDsOfElements << ", "
                 << theVector        << " )";
   }
                 << theIDsOfElements << ", "
                 << theVector        << " )";
   }
-  return aGroups;
+  return aGroups ? aGroups : new SMESH::ListOfGroups();
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -3689,7 +3689,7 @@ SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObjec
                 << theObject << ", "
                 << theVector << " )";
   }
                 << theObject << ", "
                 << theVector << " )";
   }
-  return aGroups;
+  return aGroups ? aGroups : new SMESH::ListOfGroups();
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -3914,7 +3914,7 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::smIdType_array& theIDsOfElemen
                 << theAxis          << ", "
                 << TVar( theAngle ) << " )";
   }
                 << theAxis          << ", "
                 << TVar( theAngle ) << " )";
   }
-  return aGroups;
+  return aGroups ? aGroups : new SMESH::ListOfGroups();
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -3941,7 +3941,7 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
                 << theAxis          << ", "
                 << TVar( theAngle ) << " )";
   }
                 << theAxis          << ", "
                 << TVar( theAngle ) << " )";
   }
-  return aGroups;
+  return aGroups ? aGroups : new SMESH::ListOfGroups();
 }
 
 //=======================================================================
 }
 
 //=======================================================================