Commit 2e724095 authored by Christian Kamm's avatar Christian Kamm Committed by Eike Ziller

QmlJS: Fix crash when reading malformed qmltypes files.

Task-number: QTCREATORBUG-6587
Change-Id: I0b7c65c1d7f613283e447293daf26673e88ba6e7
Reviewed-by: default avatarEike Ziller <>
parent 58955980
......@@ -145,7 +145,11 @@ void TypeDescriptionReader::readModule(UiObjectDefinition *ast)
for (UiObjectMemberList *it = ast->initializer->members; it; it = it->next) {
UiObjectMember *member = it->member;
UiObjectDefinition *component = dynamic_cast<UiObjectDefinition *>(member);
const QString typeName = Bind::toString(component->qualifiedTypeNameId);
QString typeName;
if (component)
typeName = Bind::toString(component->qualifiedTypeNameId);
if (!component || (typeName != "Component" && typeName != "ModuleApi")) {
addWarning(member->firstSourceLocation(), "Expected only 'Component' and 'ModuleApi' object definitions");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment