aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 55047e1cf9..048ff935bf 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -580,7 +580,7 @@ ReturnedValue Runtime::getElement(ExecutionContext *ctx, const ValueRef object,
}
if (idx < UINT_MAX) {
- if (!o->arrayData()->hasAttributes()) {
+ if (o->arrayData() && !o->arrayData()->hasAttributes()) {
ScopedValue v(scope, o->arrayData()->get(idx));
if (!v->isEmpty())
return v->asReturnedValue();
@@ -606,8 +606,8 @@ void Runtime::setElement(ExecutionContext *ctx, const ValueRef object, const Val
if (idx < UINT_MAX) {
if (o->arrayType() == ArrayData::Simple) {
SimpleArrayData *s = static_cast<SimpleArrayData *>(o->arrayData());
- if (s && idx < s->len() && !s->arrayData()[idx].isEmpty()) {
- s->arrayData()[idx] = value;
+ if (s && idx < s->len() && !s->data(idx).isEmpty()) {
+ s->data(idx) = value;
return;
}
}