diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp index eaeddc8e2..1279c3308 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp @@ -115,10 +115,14 @@ std::vector ViewProviderBody::claimChildren(void)const // search for objects handled (claimed) by the features for(std::vector::const_iterator it = Model.begin();it!=Model.end();++it){ - std::vector children = Gui::Application::Instance->getViewProvider(*it)->claimChildren(); - for (std::vector::const_iterator ch = children.begin(); ch != children.end(); ch++) + if (*it == NULL) continue; + Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(*it); + if (vp == NULL) continue; + std::vector children = vp->claimChildren(); + for (std::vector::const_iterator ch = children.begin(); ch != children.end(); ch++) { if ((*ch) != NULL) OutSet.insert(*ch); + } } // remove the otherwise handled objects, preserving their order so the order in the TreeWidget is correct