summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativelistmodel.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-07-09 05:35:38 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-07-09 05:35:38 (GMT)
commit49b828102626ba6faa38ea48d9f570283dd7fa9f (patch)
tree70897b6950f864e293befd2809d278ab62a7649f /src/declarative/util/qdeclarativelistmodel.cpp
parentcec6d01d17e39af6e8a139156a3b51fd45558a50 (diff)
downloadQt-49b828102626ba6faa38ea48d9f570283dd7fa9f.zip
Qt-49b828102626ba6faa38ea48d9f570283dd7fa9f.tar.gz
Qt-49b828102626ba6faa38ea48d9f570283dd7fa9f.tar.bz2
Fix crash with invalid role indexes
Diffstat (limited to 'src/declarative/util/qdeclarativelistmodel.cpp')
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp2
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)