Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / PartSet / PartSet_PartDataModel.cpp
index e9d378c300da8f71431734500e95268de7d1baaa..402244d852d7bda4b1d6c94dc3f930557a5d3fc8 100644 (file)
@@ -472,7 +472,9 @@ DocumentPtr PartSet_PartDataModel::partDocument() const
   ObjectPtr aObject = aRootDoc->object(ModelAPI_Feature::group(), myId);
   FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
   ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aFeature->firstResult()); 
-  return aPart->partDoc();
+  if (aPart.get()) // this may be null is Part feature is disabled
+    return aPart->partDoc();
+  return DocumentPtr();
 }
 
 ObjectPtr PartSet_PartDataModel::object(const QModelIndex& theIndex) const