[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;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,6 +501,9 @@ void QGIViewBalloon::draw_modifier(bool modifier)
|
||||
show();
|
||||
|
||||
const TechDraw::DrawViewPart *refObj = balloon->getViewPart();
|
||||
if (refObj == nullptr) {
|
||||
return;
|
||||
}
|
||||
if(!refObj->hasGeometry()) { //nothing to draw yet (restoring)
|
||||
balloonLabel->hide();
|
||||
hide();
|
||||
|
||||
@@ -675,6 +675,9 @@ void QGIViewDimension::draw()
|
||||
}
|
||||
|
||||
const TechDraw::DrawViewPart *refObj = dim->getViewPart();
|
||||
if (refObj == nullptr) {
|
||||
return;
|
||||
}
|
||||
if(!refObj->hasGeometry()) { //nothing to draw yet (restoring)
|
||||
datumLabel->hide();
|
||||
hide();
|
||||
|
||||
@@ -830,6 +830,9 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b
|
||||
if (!viewPart) {
|
||||
return;
|
||||
}
|
||||
if (viewSection == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!viewSection->hasGeometry()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user