]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Do not start create operation if the feature is not created.
authornds <natalia.donis@opencascade.com>
Mon, 2 Mar 2015 11:12:16 +0000 (14:12 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 2 Mar 2015 11:12:16 +0000 (14:12 +0300)
src/ModuleBase/ModuleBase_Operation.cpp

index de9a9e857adb4ab11e69a832dd9a2c57299b13df..f1a0ec715fda12caeed93c972ae246d6de78333b 100644 (file)
@@ -148,8 +148,14 @@ void ModuleBase_Operation::start()
 {
   ModelAPI_Session::get()->startOperation();
 
-  if (!myIsEditing)
-    createFeature();
+  if (!myIsEditing) {
+    FeaturePtr aFeature = createFeature();
+    // if the feature is not created, there is no sense to start the operation
+    if (aFeature.get() == NULL) {
+      ModelAPI_Session::get()->abortOperation();
+      return;
+    }
+  }
 
   startOperation();
   emit started();