diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-11-08 11:27:04 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-08 13:49:28 +0100 |
commit | 769d8ca7167cb108d82d3afbbd1cdfec23716375 (patch) | |
tree | e9dfc6c5e6453e36930fe21f8730fe441fb32911 /src/declarative/qml/qdeclarativeexpression.cpp | |
parent | e74adbb87dc099f217ff89806e55bef41c4fac86 (diff) |
Don't crash on invalid expression
Task-number: QTBUG-21310
Change-Id: I93de1c520b6f1c2aa3842e1091bcf2b34d9b0420
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativeexpression.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeexpression.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index b178045d44..0895ffa1ec 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -151,6 +151,7 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje v8::TryCatch tc; v8::Local<v8::Object> scopeobject = ep->v8engine()->qmlScope(ctxt, scope); v8::Local<v8::Script> script = ep->v8engine()->qmlModeCompile(code, filename, line); + if (tc.HasCaught()) return v8::Persistent<v8::Function>(); v8::Local<v8::Value> result = script->Run(scopeobject); if (tc.HasCaught()) return v8::Persistent<v8::Function>(); if (qmlscope) *qmlscope = qPersistentNew<v8::Object>(scopeobject); |