Salome HOME
IPAL21340
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.cxx
index aef920ec4ea2c0e61c3b4b1548a5d84008465f27..5023cdc54a45dca90ba09a108c1f847912253ab4 100644 (file)
@@ -1166,6 +1166,8 @@ SMESHGUI_ComputeOp::~SMESHGUI_ComputeOp()
 void SMESHGUI_ComputeOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   computeMesh();
 }
 
@@ -1268,6 +1270,8 @@ void SMESHGUI_PrecomputeOp::startOperation()
   }
 
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
 
   // disconnect slot from preview dialog to have Apply from results of compute operation only 
   disconnect( myDlg, SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
@@ -1647,6 +1651,8 @@ void SMESHGUI_EvaluateOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::evaluateDlg();
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   evaluateMesh();
 }
 
@@ -1681,9 +1687,12 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
   SMESH::long_array_var aRes;
 
   _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
+  if ( !aMeshSObj ) //  IPAL21340
+    return;
+
   bool hasShape = myMesh->HasShapeToMesh();
   bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
-  if ( shapeOK && aMeshSObj )
+  if ( shapeOK )
   {
     myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
     SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();