PartDesign: Fix crash on editing feature outside of body
This commit is contained in:
committed by
Chris Hennes
parent
7a266b1d78
commit
d712537638
@@ -143,9 +143,16 @@ bool ViewProvider::setEdit(int ModNum)
|
||||
}
|
||||
}
|
||||
|
||||
previouslyShownViewProvider = dynamic_cast<ViewProvider*>(
|
||||
Gui::Application::Instance->getViewProvider(getBodyViewProvider()->getShownFeature())
|
||||
);
|
||||
// This is handling for an erroneous case where features are for some reason placed outside
|
||||
// the body container. That should never happen, but in some cases we find models with a
|
||||
// problem like that.
|
||||
if (ViewProviderBody* bodyViewProvider = getBodyViewProvider()) {
|
||||
PartDesign::Feature* shownFeature = bodyViewProvider->getShownFeature();
|
||||
|
||||
previouslyShownViewProvider = freecad_cast<ViewProvider*>(
|
||||
Gui::Application::Instance->getViewProvider(shownFeature)
|
||||
);
|
||||
}
|
||||
|
||||
// clear the selection (convenience)
|
||||
Gui::Selection().clearSelection();
|
||||
|
||||
Reference in New Issue
Block a user