From: nds Date: Mon, 2 Mar 2015 11:12:16 +0000 (+0300) Subject: Do not start create operation if the feature is not created. X-Git-Tag: V_1.0.2~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=161d5888fd3c2748900c8fe047ef14b2bdf4afdd;p=modules%2Fshaper.git Do not start create operation if the feature is not created. --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index de9a9e857..f1a0ec715 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -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();