diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-01 12:27:28 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-05 12:27:03 +0100 |
commit | 7fa4b8600be74c10c555ba07317e9b754f18ce3d (patch) | |
tree | f5d0ba9c076f4b9f2dfba0a510a1b1b26ea10d0a /src/qml | |
parent | 5375c095c3eb71c669053c4ca569a960dc76fabf (diff) |
Fix crash with when evaluating bindings with QQmlExpression that throw exceptions
We must handle a thrown exception and cannot pass the undefined value back to
QV8Engine::toVariant.
Change-Id: Ia466b175706dccd513895ef5bb166b811fbdc26b
Task-number: QTBUG-41860
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 947b55f15d..8c7c31d86c 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -275,7 +275,8 @@ QVariant QQmlExpressionPrivate::value(bool *isUndefined) { QV4::Scope scope(QV8Engine::getV4(ep->v8engine())); QV4::ScopedValue result(scope, v4value(isUndefined)); - rv = ep->v8engine()->toVariant(result, -1); + if (!hasError()) + rv = ep->v8engine()->toVariant(result, -1); } ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete. |