aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-12-02 12:47:28 +0100
committerLars Knoll <lars.knoll@qt.io>2016-12-09 14:01:38 +0000
commitf1dca03794f8db353655d44e742a2960f1f69070 (patch)
tree3741f420b0652c5786a51cc952f04e402fb03a25 /src/qml/jsruntime
parentb4f4caababf3c561dbf61a4c75450598cb424ca0 (diff)
Don't create a QML function is the signal parameters are invalid
Moves the error checking to where the error occurs. Change-Id: I2590d3a9d41f41c16d19e4f5883b78a8b28a883c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 172b29e88b..c65882ed7a 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -208,8 +208,10 @@ Heap::FunctionObject *FunctionObject::createQmlFunction(QQmlContextData *qmlCont
QV4::Scoped<QmlContext> wrapperContext(valueScope, QmlContext::create(global, qmlContext, scopeObject));
if (!signalParameters.isEmpty()) {
- if (error)
+ if (error) {
QQmlPropertyCache::signalParameterStringForJS(engine, signalParameters, error);
+ return 0;
+ }
runtimeFunction->updateInternalClass(engine, signalParameters);
}