Salome HOME
IPAL53097: At med export "Automatically define space dimension" does not work
[modules/smesh.git] / src / SMESH / SMESH_Gen.cxx
index 8fadef162a25872a02eecbf736d6c2c076b0ccc7..4c264d50ae52a996e94983c8c87188d0ba7df108 100644 (file)
@@ -441,7 +441,8 @@ void SMESH_Gen::setCurrentSubMesh(SMESH_subMesh* sm)
 {
   if ( sm )
     _sm_current.push_back( sm );
-  else
+
+  else if ( !_sm_current.empty() )
     _sm_current.pop_back();
 }
 
@@ -943,7 +944,7 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh&               theMesh,
   if ( !hasAlgo ) {
     ret = false;
     theErrors.push_back( TAlgoStateError() );
-    theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
+    theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, theMesh.HasShapeToMesh() ? 1 : 3, true );
   }
 
   return ret;