diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-02-24 14:40:11 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-27 02:39:41 +0100 |
commit | d2921ffc52fed380326f8abb86d6d659cc47f9d1 (patch) | |
tree | 88502570f2e5b3fee145dc89608f21ab018c3e90 /src | |
parent | de02b0f6ba4c422ff617308617b32804b15d1f7e (diff) |
Check engine equality condition inside null ptr check
Previously, we asserted if the engine associated with the two external
resources from the arguments to the object comparison callback were
not equal, prior to checking that the external resources were non-null.
Task-number: QTBUG-24489
Change-Id: I4b2bd2377fcf38163d1341e43e056b1405ab72ac
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/v8/qv8engine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/qml/v8/qv8engine.cpp b/src/declarative/qml/v8/qv8engine.cpp index 04589fe244..70e6528f0a 100644 --- a/src/declarative/qml/v8/qv8engine.cpp +++ b/src/declarative/qml/v8/qv8engine.cpp @@ -75,12 +75,14 @@ static bool ObjectComparisonCallback(v8::Local<v8::Object> lhs, v8::Local<v8::Ob if (lhs == rhs) return true; + if (lhs.IsEmpty() || rhs.IsEmpty()) + return false; + QV8ObjectResource *lhsr = static_cast<QV8ObjectResource*>(lhs->GetExternalResource()); QV8ObjectResource *rhsr = static_cast<QV8ObjectResource*>(rhs->GetExternalResource()); - Q_ASSERT(lhsr->engine == rhsr->engine); - if (lhsr && rhsr) { + Q_ASSERT(lhsr->engine == rhsr->engine); QV8ObjectResource::ResourceType lhst = lhsr->resourceType(); QV8ObjectResource::ResourceType rhst = rhsr->resourceType(); |