From 7e7697f9eb844fccd97b6f87ac8b197a9299c2fd Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Fri, 20 Sep 2013 20:00:21 +0200 Subject: [PATCH] Made Body::claimChildren() stabler against NULL items --- src/Mod/PartDesign/Gui/ViewProviderBody.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp index eaeddc8e24..1279c3308b 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