diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-26 15:35:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-28 06:56:24 +0200 |
commit | a3e6e7ae74e80e4eff61581faa3cc4977992b8d0 (patch) | |
tree | 9d13c4dee00328e9e8a2c3b8865d5836bc927047 | |
parent | 184e27c0e69f9f8c342339e83cdf79ec5a97b58e (diff) |
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 <aalpert@blackberry.com>
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<QQmlTypeData::TypeReference> &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 { |