summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-02 18:27:42 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-06-03 08:47:44 -0300
commitc81e079e0ac53c96d87e32e060a9b98f6a563bfc (patch)
treebeacfbdfa91f5f093c40370669ef09cd1a5c564d
parente2738233c5bffb1fd0ad0f44c1a930c366329faa (diff)
downloadshiboken-c81e079e0ac53c96d87e32e060a9b98f6a563bfc.tar.gz
shiboken-c81e079e0ac53c96d87e32e060a9b98f6a563bfc.tar.xz
shiboken-c81e079e0ac53c96d87e32e060a9b98f6a563bfc.zip
Avoid crashing CppGenerator if the module entry couldn't be retrieved.
-rw-r--r--cppgenerator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 53f86a4f..d4e0c5fa 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -3074,7 +3074,9 @@ void CppGenerator::finishGeneration()
s << endl;
TypeSystemTypeEntry* moduleEntry = reinterpret_cast<TypeSystemTypeEntry*>(TypeDatabase::instance()->findType(packageName()));
- CodeSnipList snips = moduleEntry->codeSnips();
+ CodeSnipList snips;
+ if (moduleEntry)
+ snips = moduleEntry->codeSnips();
// module inject-code native/beginning
if (!snips.isEmpty()) {