coverity#440338 Dereference null return value

Change-Id: I5da7c1d8fe7f4632b386a02dd54f4b203a00fc25
This commit is contained in:
Caolán McNamara
2014-01-28 09:22:26 +00:00
parent 5806a777b0
commit 51f252dbf2

View File

@@ -135,7 +135,14 @@ static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
Reference< XInterface > () );
}
globalDict = PyRef( PyModule_GetDict(PyImport_AddModule("__main__")));
PyObject* pModule = PyImport_AddModule("__main__");
if (!pModule)
{
throw RuntimeException("can't import __main__ module", Reference< XInterface > ());
}
globalDict = PyRef( PyModule_GetDict(pModule));
if( ! globalDict.is() ) // FATAL !
{