summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Arnaud-Cormos <nicolas.arnaud-cormos.qnx@kdab.com>2012-05-15 17:02:42 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-05-25 08:15:46 (GMT)
commita3a7553dd52a90a95cfeef80d36b1fd671b335b2 (patch)
tree0465e36ac5cccbfc973dae80dc3b3b1ed5a5cc78 /src
parent8f22e4bed8973758ef175f4d5d7f725009db9eb6 (diff)
downloadQt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.zip
Qt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.tar.gz
Qt-a3a7553dd52a90a95cfeef80d36b1fd671b335b2.tar.bz2
Fix crash when using aliases and variants
Right now, the parser crash when using id.variant.property for an alias. The current patch fix the crash, and it displays an error message in the console now (like QtQuick 2). Task-number: QTBUG-25341 Change-Id: I5e2c13f487655fd2b90129c5693f5daf3f77984b Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
index 5c2cda7..6666532 100644
--- a/src/declarative/qml/qdeclarativevaluetype_p.h
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -92,7 +92,7 @@ public:
static void registerValueTypes();
QDeclarativeValueType *operator[](int idx) const {
- if (idx >= (int)QVariant::UserType) return 0;
+ if (idx < 0 || idx >= (int)QVariant::UserType) return 0;
else return valueTypes[idx];
}