Check return value of getMDIViewPage() a second time
When exporting a hidden TechDraw::Page with exportPageAs[Pdf|SVG] a Segmentation Fault occured. The return value of getMDIViewPage() was only checked for the first call, but not for the second call. showMDIViewPage() silently returns, when the TechDraw::Page is hidden and does not load the page.
This commit is contained in:
@@ -193,7 +193,11 @@ private:
|
||||
} else {
|
||||
vpp->showMDIViewPage();
|
||||
mdi = vpp->getMDIViewPage();
|
||||
mdi->printPdf(filePath);
|
||||
if (mdi) {
|
||||
mdi->printPdf(filePath);
|
||||
} else {
|
||||
throw Py::TypeError("Page not available! Is it Hidden?");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,7 +238,11 @@ private:
|
||||
} else {
|
||||
vpp->showMDIViewPage();
|
||||
mdi = vpp->getMDIViewPage();
|
||||
mdi->saveSVG(filePath);
|
||||
if (mdi) {
|
||||
mdi->saveSVG(filePath);
|
||||
} else {
|
||||
throw Py::TypeError("Page not available! Is it Hidden?");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user