Skip to content

Commit

Permalink
[TD]Prevent crash in Section if BaseView deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Oct 1, 2019
1 parent d9fa2b3 commit 303c84e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Mod/TechDraw/App/DrawViewSection.cpp
Expand Up @@ -197,6 +197,10 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
}

App::DocumentObject* base = BaseView.getValue();
if (base == nullptr) {
return new App::DocumentObjectExecReturn("BaseView object not found");
}

if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId()))
return new App::DocumentObjectExecReturn("BaseView object is not a DrawViewPart object");

Expand Down

0 comments on commit 303c84e

Please sign in to comment.