summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativexmllistmodel.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-10-04 03:39:47 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-10-04 03:39:47 (GMT)
commitb2e79e0b5c26e70ad586cb965808059330cc0893 (patch)
tree626fe91a5464dda83ced19d6e7d7e34b56b00c17 /src/declarative/util/qdeclarativexmllistmodel.cpp
parentefb0d6a986b991432d37c15151df7538fba8f430 (diff)
downloadQt-b2e79e0b5c26e70ad586cb965808059330cc0893.zip
Qt-b2e79e0b5c26e70ad586cb965808059330cc0893.tar.gz
Qt-b2e79e0b5c26e70ad586cb965808059330cc0893.tar.bz2
Prevent crash in XmlListModel when appending an empty role.
Diffstat (limited to 'src/declarative/util/qdeclarativexmllistmodel.cpp')
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 24edc89..ce5b483 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -476,7 +476,7 @@ public:
void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role)
{
QDeclarativeXmlListModel *_this = qobject_cast<QDeclarativeXmlListModel *>(list->object);
- if (_this) {
+ if (_this && role) {
int i = _this->d_func()->roleObjects.count();
_this->d_func()->roleObjects.append(role);
if (_this->d_func()->roleNames.contains(role->name())) {