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-07 10:58:28 +01:00
committed by wmayer
parent 198c2258d4
commit 7189b8ebc0
4 changed files with 28 additions and 10 deletions
+10 -2
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;