Salome HOME
Command New Document provided
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.cpp
index 9d1d1e72490207b1b9a426b368d3ce2dc5532704..c4c09491de67d2fe34635116cb1ee8888ef4fc70 100644 (file)
@@ -33,7 +33,9 @@ void XGUI_SelectionMgr::onSelectionChanged()
     FeaturePtr aFeature = mySelectedData.first();
 
     std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-    aMgr->setCurrentDocument(aFeature->data()->docRef("PartDocument")->value());
+    std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
+    if (aDocRef)
+      aMgr->setCurrentDocument(aDocRef->value());
   }
 
   emit selectionChanged();