Salome HOME
Merge branch 'Dev_2.8.0'
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.cpp
index 7d8376aab9627952b2b84f41d5a6bf5ca1f5a0e7..d03130b59b2f0b01c2b934f22457d97eb10ea545 100644 (file)
@@ -14,7 +14,8 @@
 // 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #include "ModelHighAPI_Tools.h"
@@ -173,8 +174,10 @@ void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute)
 {
   theAttribute->clear();
-  for (auto it = theValue.begin(); it != theValue.end(); ++it)
-    theAttribute->append(it->resultSubShapePair().first); // use only context
+  for (auto it = theValue.begin(); it != theValue.end(); ++it) {
+    if (it->resultSubShapePair().first)
+      theAttribute->append(it->resultSubShapePair().first); // use only context
+  }
 }
 
 //--------------------------------------------------------------------------------------