From b15f96c3256264944a39fbf04cc186d980042571 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Wed, 9 May 2012 11:50:47 +1000 Subject: [PATCH] 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 --- src/qml/qml/qqmlexpression.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 67a1195..c333df1 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; -- 2.7.4