diff options
author | Nicolas Arnaud-Cormos <nicolas.arnaud-cormos.qnx@kdab.com> | 2012-05-15 17:02:42 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 08:15:46 (GMT) |
commit | a3a7553dd52a90a95cfeef80d36b1fd671b335b2 (patch) | |
tree | 0465e36ac5cccbfc973dae80dc3b3b1ed5a5cc78 /src/declarative | |
parent | 8f22e4bed8973758ef175f4d5d7f725009db9eb6 (diff) | |
download | Qt-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/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativevaluetype_p.h | 2 |
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]; } |