diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-05-09 11:50:47 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-09 04:36:41 +0200 |
commit | b15f96c3256264944a39fbf04cc186d980042571 (patch) | |
tree | c94afd3696bd41d0471a7da5faa775dbb4c7d2b5 /src | |
parent | 5aa875f82d5ffe1b1d67fbae47ce7f8eb63c8ebe (diff) |
Return earlier if script.context() is invalid
If script.context() is invalid, the qml expression is invalid too,
so no need to continue contructing the expression at all.
Change-Id: I5a34cf0eb1c2cc0b2bba7eed736073050f3240e9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 67a11959fc..c333df1d02 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -216,6 +216,10 @@ QQmlExpression::QQmlExpression(const QQmlScriptString &script, QObject *parent) : QObject(*new QQmlExpressionPrivate, parent) { Q_D(QQmlExpression); + + if (!script.context()->isValid()) + return; + bool defaultConstruction = false; int id = script.d.data()->bindingId; |