aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-13 21:57:00 +0100
committerLars Knoll <lars.knoll@qt.io>2018-03-14 12:10:52 +0000
commitb54679fcd0c183f3e85fc6ab89033b6f8d510e45 (patch)
tree93fc0107b60f65cc051e4964bf73abd8a6327cbc /src/qml/jsruntime
parent1b996c138f6afae7ccf9d9ec87036768fd8ef329 (diff)
Fix a crash in Object.proto.propertyIsEnumerable
If the property being queried is an array index, we would call ArrayData::getProperty with a the Property pointer being null. We correctly handle this for named properties, but didn't here. Change-Id: Iba98a13f276432f273545c87cfc998fe64f45c51 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h
index 9356670b6d..b2573b4491 100644
--- a/src/qml/jsruntime/qv4arraydata_p.h
+++ b/src/qml/jsruntime/qv4arraydata_p.h
@@ -304,9 +304,11 @@ bool ArrayData::getProperty(uint index, Property *p, PropertyAttributes *attrs)
}
*attrs = attributes(index);
- p->value = *(Index{ this, mapped });
- if (attrs->isAccessor())
- p->set = *(Index{ this, mapped + 1 /*Object::SetterOffset*/ });
+ if (p) {
+ p->value = *(Index{ this, mapped });
+ if (attrs->isAccessor())
+ p->set = *(Index{ this, mapped + 1 /*Object::SetterOffset*/ });
+ }
return true;
}