Salome HOME
PAL8196. correct the previous fix
authoreap <eap@opencascade.com>
Fri, 24 Jun 2005 11:17:59 +0000 (11:17 +0000)
committereap <eap@opencascade.com>
Fri, 24 Jun 2005 11:17:59 +0000 (11:17 +0000)
src/SMESH/SMESH_Gen.cxx

index a6e1bd55023b1e684dbbf1814eb2888b0b979b0d..7a3c34a50a0f8d309bcebfc26aacba9878ac1b16 100644 (file)
@@ -603,7 +603,10 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
   list <const SMESHDS_Hypothesis * > algoList;
   aMesh.GetHypotheses( aShape, filter, algoList, true );
 
   list <const SMESHDS_Hypothesis * > algoList;
   aMesh.GetHypotheses( aShape, filter, algoList, true );
 
-  if (algoList.size() != 1 ) { // check if there is one algo several times
+  if ( algoList.empty() )
+    return NULL;
+
+  if (algoList.size() > 1 ) { // check if there is one algo several times
     list <const SMESHDS_Hypothesis * >::iterator algo = algoList.begin();
     for ( ; algo != algoList.end(); ++algo )
       if ( (*algo) != algoList.front() &&
     list <const SMESHDS_Hypothesis * >::iterator algo = algoList.begin();
     for ( ; algo != algoList.end(); ++algo )
       if ( (*algo) != algoList.front() &&