diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-10 22:04:54 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-12 14:52:50 +0100 |
commit | 447844aa25754db7e868469de4537af4331709ac (patch) | |
tree | 80245a0d948e87c8cfd7a35eb5fdc93a65105ccd /src/qml/jsruntime/qv4include.cpp | |
parent | 56211be8a0429fb3e3fa268c7698e1df079aa04e (diff) |
Get rid of Value::engine()
This method is not guaranteed to return an engine. We're safer
checking for the value being an object first and then getting
the engine from there.
Change-Id: I5c95e675337e545f2421613bd31c42d1e58d6f9a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4include.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index 03eb1505f4..2627e26d4b 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -92,9 +92,9 @@ QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status stat void QV4Include::callback(const QV4::ValueRef callback, const QV4::ValueRef status) { - QV4::ExecutionEngine *v4 = callback->engine(); - if (!v4) + if (!callback->isObject()) return; + QV4::ExecutionEngine *v4 = callback->asObject()->engine(); QV4::Scope scope(v4); QV4::ScopedFunctionObject f(scope, callback); if (!f) |