diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp index c15f0ec13c..14dc2882c3 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp @@ -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?"); + } } } }