Skip to content

Commit

Permalink
Merge pull request #4121 from everlanes/TechDraw_Segfault
Browse files Browse the repository at this point in the history
[TD] Check return value of getMDIViewPage() a second time
  • Loading branch information
yorikvanhavre committed Dec 14, 2020
2 parents fe721a1 + a6e29e3 commit 0e556a0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp
Expand Up @@ -193,7 +193,11 @@ class Module : public Py::ExtensionModule<Module>
} else {
vpp->showMDIViewPage();
mdi = vpp->getMDIViewPage();
mdi->printPdf(filePath);
if (mdi) {
mdi->printPdf(filePath);
} else {
throw Py::TypeError("Page not available! Is it Hidden?");
}
}
}
}
Expand Down Expand Up @@ -234,7 +238,11 @@ class Module : public Py::ExtensionModule<Module>
} else {
vpp->showMDIViewPage();
mdi = vpp->getMDIViewPage();
mdi->saveSVG(filePath);
if (mdi) {
mdi->saveSVG(filePath);
} else {
throw Py::TypeError("Page not available! Is it Hidden?");
}
}
}
}
Expand Down

0 comments on commit 0e556a0

Please sign in to comment.