diff options
-rw-r--r-- | src/qml/qml/v8/qv8engine_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 8f724fa2eb..1296973394 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -125,7 +125,7 @@ class QQmlV4Function { public: int length() const { return argc; } - QV4::Value operator[](int idx) { return args[idx]; } + QV4::Value operator[](int idx) { return idx < argc ? args[idx] : QV4::Value::undefinedValue(); } QQmlContextData *context() { return ctx; } QV4::Value qmlGlobal() { return global; } void setReturnValue(const QV4::Value &rv) { *retVal = rv; } |