+ fix crash in ViewProviderPad::onDelete

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5032 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-10-17 08:15:25 +00:00
parent 6e91d94236
commit 60e103c962

View File

@ -119,15 +119,15 @@ bool ViewProviderPad::onDelete(const std::vector<std::string> &)
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(getObject());
Sketcher::SketchObject *pcSketch;
App::DocumentObject *pcSupport;
if(pcPad->Sketch.getValue() ){
if (pcPad->Sketch.getValue()){
pcSketch = static_cast<Sketcher::SketchObject*>(pcPad->Sketch.getValue());
pcSupport = pcSketch->Support.getValue();
}
// if abort command deleted the object the support is visible again
if(pcSketch && Gui::Application::Instance->getViewProvider(pcSketch))
if (pcSketch && Gui::Application::Instance->getViewProvider(pcSketch))
Gui::Application::Instance->getViewProvider(pcSketch)->show();
if(pcPad && Gui::Application::Instance->getViewProvider(pcSupport))
if (pcSupport && Gui::Application::Instance->getViewProvider(pcSupport))
Gui::Application::Instance->getViewProvider(pcSupport)->show();
return true;