Salome HOME
Fixes for issue #1956 and issue #2104 : correctly remove features on part remove.
[modules/shaper.git] / src / Model / Model_ResultPart.cpp
index d067868692f3cc37314523c448165cbd02fb313c..2beb5f56213aa4cfca6d278abfa126cf349aa37c 100644 (file)
@@ -177,7 +177,7 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultPart::shape()
         for(int a = aDoc->size(aBodyGroup) - 1; a >= 0; a--) {
           ResultPtr aBody = std::dynamic_pointer_cast<ModelAPI_Result>(aDoc->object(aBodyGroup, a));
           // "object" method filters out disabled and concealed anyway, so don't check
-          if (aBody.get() && aBody->shape().get()) {
+          if (aBody.get() && aBody->data()->isValid() && aBody->shape().get()) {
             TopoDS_Shape aShape = *(aBody->shape()->implPtr<TopoDS_Shape>());
             if (!aShape.IsNull()) {
               aBuilder.Add(aResultComp, aShape);