diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-09 05:35:38 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-09 05:35:38 (GMT) |
commit | 49b828102626ba6faa38ea48d9f570283dd7fa9f (patch) | |
tree | 70897b6950f864e293befd2809d278ab62a7649f /src | |
parent | cec6d01d17e39af6e8a139156a3b51fd45558a50 (diff) | |
download | Qt-49b828102626ba6faa38ea48d9f570283dd7fa9f.zip Qt-49b828102626ba6faa38ea48d9f570283dd7fa9f.tar.gz Qt-49b828102626ba6faa38ea48d9f570283dd7fa9f.tar.bz2 |
Fix crash with invalid role indexes
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index deb835d..3ede335 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -1022,6 +1022,8 @@ QVariant NestedListModel::data(int index, int role) const Q_ASSERT(_root && index >= 0 && index < _root->values.count()); checkRoles(); QVariant rv; + if (roleStrings.count() < role) + return rv; ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index)); if (!node) |