X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Interface.cpp;h=cb0373bfa4c2ef4582f6851a6d308bb151dcc143;hb=11e45272e1ca920eb2b979daeb5d42c24ed14a2e;hp=8e35b13be1b88f0fec6a144d58b11d7bcdf38f82;hpb=fd08aa05db79437b007fb2d691baca021a4f4aa9;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.cpp b/src/ModelHighAPI/ModelHighAPI_Interface.cpp index 8e35b13be..cb0373bfa 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Interface.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "ModelHighAPI_Interface.h" @@ -89,7 +88,8 @@ void ModelHighAPI_Interface::execute(bool isForce) void ModelHighAPI_Interface::setName(const std::string& theName) { - feature()->data()->setName(theName); + if (feature().get()) + feature()->data()->setName(theName); } std::string ModelHighAPI_Interface::name() const @@ -111,10 +111,12 @@ std::list ModelHighAPI_Interface::results() const std::list aSelectionList; - std::list > aResults = feature()->results(); - for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) { - if (!(*it)->isDisabled()) - aSelectionList.push_back(ModelHighAPI_Selection(*it)); + if (feature().get()) { + std::list > aResults = feature()->results(); + for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) { + if (!(*it)->isDisabled()) + aSelectionList.push_back(ModelHighAPI_Selection(*it)); + } } return aSelectionList;