Fix segfault on missing Anchor view

- test script did not create Anchor(Front) view.  DPG/DVP did not
  handle missing Anchor properly
This commit is contained in:
wandererfan
2019-03-05 12:51:00 -05:00
committed by wmayer
parent db3a69ba11
commit d58b86c52f
4 changed files with 28 additions and 10 deletions

View File

@@ -239,10 +239,18 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
}
const std::vector<App::DocumentObject*>& links = Source.getValues();
if (links.empty()) {
Base::Console().Log("DVP::execute - %s - No Sources - creation time?\n",getNameInDocument());
return App::DocumentObject::StdReturn;
}
TopoDS_Shape shape = getSourceShape();
TopoDS_Shape shape = getSourceShape(); //if shape is null, it is probably obj creation time.
if (shape.IsNull()) {
return new App::DocumentObjectExecReturn("DVP - Linked shape object is invalid");
Base::Console().Log("DVP::execute - %s - source shape is invalid - creation time?\n",
getNameInDocument());
return App::DocumentObject::StdReturn;
}
gp_Pnt inputCenter;