diff options
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp index 7bbb7df..2823496 100644 --- a/src/declarative/qml/qmlobjectscriptclass.cpp +++ b/src/declarative/qml/qmlobjectscriptclass.cpp @@ -153,10 +153,11 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name, if (!evalContext && context()) { // Global object, QScriptContext activation object, QmlContext object QScriptValue scopeNode = scopeChainValue(context(), -3); - Q_ASSERT(scopeNode.isValid()); - Q_ASSERT(scriptClass(scopeNode) == enginePrivate->contextClass); + if (scopeNode.isValid()) { + Q_ASSERT(scriptClass(scopeNode) == enginePrivate->contextClass); - evalContext = enginePrivate->contextClass->contextFromValue(scopeNode); + evalContext = enginePrivate->contextClass->contextFromValue(scopeNode); + } } if (evalContext) { @@ -332,10 +333,11 @@ void QmlObjectScriptClass::setProperty(QObject *obj, if (!evalContext && context()) { // Global object, QScriptContext activation object, QmlContext object QScriptValue scopeNode = scopeChainValue(context(), -3); - Q_ASSERT(scopeNode.isValid()); - Q_ASSERT(scriptClass(scopeNode) == enginePriv->contextClass); + if (scopeNode.isValid()) { + Q_ASSERT(scriptClass(scopeNode) == enginePriv->contextClass); - evalContext = enginePriv->contextClass->contextFromValue(scopeNode); + evalContext = enginePriv->contextClass->contextFromValue(scopeNode); + } } QmlAbstractBinding *delBinding = QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0); |