From 161d5888fd3c2748900c8fe047ef14b2bdf4afdd Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 2 Mar 2015 14:12:16 +0300 Subject: [PATCH] Do not start create operation if the feature is not created. --- src/ModuleBase/ModuleBase_Operation.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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(); -- 2.39.2