[TD]Prevent crash in Section if BaseView deleted

This commit is contained in:
wandererfan
2019-09-24 08:03:35 -04:00
committed by WandererFan
parent 87cc310e83
commit 83f40bd937

View File

@@ -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");