aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 7ae25e48c..53b455b2a 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -2250,7 +2250,10 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea
if (m_defaultPackage.isEmpty()) { // Extending default, see addBuiltInContainerTypes()
auto moduleEntry = std::const_pointer_cast<TypeSystemTypeEntry>(m_context->db->defaultTypeSystemType());
- Q_ASSERT(moduleEntry);
+ if (!moduleEntry) {
+ m_error = "No type system entry found (\"package\" attribute missing?)."_L1;
+ return {};
+ }
m_defaultPackage = moduleEntry->name();
return moduleEntry;
}
@@ -3595,6 +3598,8 @@ bool TypeSystemParser::startElement(const ConditionalStreamReader &reader, Stack
switch (element) {
case StackElement::Root:
top->entry = parseRootElement(reader, versionRange.since, &attributes);
+ if (!top->entry)
+ return false;
break;
case StackElement::LoadTypesystem:
if (!loadTypesystem(reader, &attributes))