Salome HOME
IPAL21340
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.cxx
index fc143d84df665b546e0583e9e40ce14e2fce7be4..5023cdc54a45dca90ba09a108c1f847912253ab4 100644 (file)
@@ -651,7 +651,7 @@ void SMESHGUI_BaseComputeOp::startOperation()
                             tr("SMESH_WRN_WARNING"),
                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
     onCancel();
-
+    return;
   }
   myMainShape = myMesh->GetShapeToMesh();
 
@@ -676,9 +676,11 @@ void SMESHGUI_BaseComputeOp::computeMesh()
   bool computeFailed = true, memoryLack = false;
 
   _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
+  if ( !aMeshSObj ) // IPAL 21340
+    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();
@@ -1164,6 +1166,8 @@ SMESHGUI_ComputeOp::~SMESHGUI_ComputeOp()
 void SMESHGUI_ComputeOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   computeMesh();
 }
 
@@ -1266,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() ) );
@@ -1645,6 +1651,8 @@ void SMESHGUI_EvaluateOp::startOperation()
 {
   SMESHGUI_BaseComputeOp::evaluateDlg();
   SMESHGUI_BaseComputeOp::startOperation();
+  if (myMesh->_is_nil())
+    return;
   evaluateMesh();
 }
 
@@ -1662,7 +1670,7 @@ LightApp_Dialog* SMESHGUI_EvaluateOp::dlg() const
 
 //================================================================================
 /*!
- * \brief evaluaateMesh()
+ * \brief evaluateMesh()
 */
 //================================================================================
 
@@ -1679,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();