aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-14 10:10:13 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-14 12:38:36 +0100
commit212e961fc8abefb23f5de3c6057556caeeacdc30 (patch)
tree65a5866f013e7f5ca14f3ad4678a69cc9340cde7 /src/qml/types
parent1656d6006bb797ad8489a0d8034f65d670895834 (diff)
Fix crash when appending arrays to sub models in list models
The elements are still inaccessible, but at least it doesn't crash. This is consistent with the behavior in Qt 5.0, where it didn't crash because the v8 object handle returned an empty array for the property names because the individual array element wasn't an object. Bug QTBUG-12117 tracks support for arrays in list models. Task-number: QTBUG-35891 Change-Id: Ief446341344977a1473bca474ca5ba934e950468 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmllistmodel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 37742a3667..4a382a1dc5 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -486,6 +486,9 @@ void ListModel::set(int elementIndex, QV4::ObjectRef object, QVector<int> *roles
void ListModel::set(int elementIndex, QV4::ObjectRef object, QV8Engine *eng)
{
+ if (!object)
+ return;
+
ListElement *e = elements[elementIndex];
QV4::ExecutionEngine *v4 = object->engine();