aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 045869e15d..12de9ffebd 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -941,7 +941,10 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
QObject *assign = objects.pop();
const List &list = lists.top();
- list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, assign);
+ if (list.qListProperty.append)
+ list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, assign);
+ else
+ VME_EXCEPTION(tr("Cannot assign object to read only list"), -1);
QML_END_INSTR(StoreObjectQList)
QML_BEGIN_INSTR(AssignObjectList)
@@ -959,8 +962,10 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
if (!ptr)
VME_EXCEPTION(tr("Cannot assign object to list"), instr.line);
-
- list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, ptr);
+ if (list.qListProperty.append)
+ list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, ptr);
+ else
+ VME_EXCEPTION(tr("Cannot assign object to read only list"), -1);
QML_END_INSTR(AssignObjectList)
QML_BEGIN_INSTR(StoreInterface)