From a3e6e7ae74e80e4eff61581faa3cc4977992b8d0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 26 Aug 2013 15:35:19 +0200 Subject: Fix crash when trying to set versioned group properties If a property isn't available due to revisioning, we print an error message. Producing the error message should be done with care of obj->type being -1 to avoid out-of-bounds on the output->types array. Task-number: QTBUG-33179 Change-Id: I7bd420f2dfa0ca2d616340a68999d58022974435 Reviewed-by: Alan Alpert --- src/qml/qml/qqmlcompiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 7b27a4c314..7731c73c81 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -1781,7 +1781,9 @@ bool QQmlCompiler::buildProperty(QQmlScript::Property *prop, if (d == 0 && notInRevision) { const QList &resolvedTypes = unit->resolvedTypes(); - const QQmlTypeData::TypeReference &type = resolvedTypes.at(obj->type); + QQmlTypeData::TypeReference type; + if (obj->type != -1) + type = resolvedTypes.at(obj->type); if (type.type) { COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(elementName(obj)).arg(prop->name().toString()).arg(type.type->module()).arg(type.majorVersion).arg(type.minorVersion)); } else { -- cgit v1.2.3