Fix scan coverity issues:

CID 184294: Uncaught exception
CID 183597: Unchecked return value
CID 175809: Dereference before null check
CID 175810: Logically dead code
CID 133000: Uninitialized scalar variable
CID 133001: Uninitialized scalar variable
CID 183591: Explicit null dereferenced
This commit is contained in:
wmayer
2018-11-13 16:47:58 +01:00
parent 735b0a18b9
commit a7094210f8
7 changed files with 33 additions and 26 deletions

View File

@@ -610,9 +610,12 @@ PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args)
return NULL;
PythonWrapper wrap;
wrap.loadCoreModule();
wrap.loadGuiModule();
wrap.loadWidgetsModule();
if (!wrap.loadCoreModule() ||
!wrap.loadGuiModule() ||
!wrap.loadWidgetsModule()) {
PyErr_SetString(PyExc_RuntimeError, "Failed to load Python wrapper for Qt");
return 0;
}
try {
return Py::new_reference_to(wrap.fromQWidget(Gui::getMainWindow(), "QMainWindow"));
}