[TD]fix potential nullptr while restoring
This commit is contained in:
@@ -219,6 +219,11 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
// Base::Console().Message("DVD::execute() - %s\n", getNameInDocument());
|
||||
if (!keepUpdated()) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
DrawViewPart* dvp = getViewPart();
|
||||
if (dvp == nullptr) {
|
||||
Base::Console().Message("DVD::execute - no DVP!\n");
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
//any empty Reference2D??
|
||||
@@ -716,8 +721,11 @@ double DrawViewDimension::getDimValue()
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (getViewPart() == nullptr) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!getViewPart()->hasGeometry()) { //happens when loading saved document
|
||||
if (!getViewPart()->hasGeometry() ) { //happens when loading saved document
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user