Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Reference.cpp
index f427b7e921fe59265c042d29cbd9e38cc50a4eea..445490e8faf51b5f4e0442229406e0e194a1fd30 100644 (file)
@@ -1,10 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
-// File:        FeaturesAPI_Reference.cpp
-// Created:     04 August 2016
-// Author:      Mikhail Ponikarov
-
-//--------------------------------------------------------------------------------------
 #include "ModelHighAPI_Reference.h"
 
 #include <ModelAPI_AttributeReference.h>
@@ -29,6 +41,11 @@ ModelHighAPI_Reference::ModelHighAPI_Reference(
   if (!myObject) {
     theValue->execute(true);
     myObject = std::shared_ptr<ModelAPI_Object>(theValue->defaultResult());
+    if (!myObject) {
+      // [bos #26534] EDF 24265 - Problem of recover in TUI
+      // Feature can have no results, store the feature itself
+      myObject = std::shared_ptr<ModelAPI_Object>(theValue->feature());
+    }
   }
 }