From 61f81db089f45fe56419bc4b695bdbb475b0684a Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 24 Feb 2010 15:46:10 +0200 Subject: QScriptValue::isQMetaObject crash fix. QScriptValue::isQMetaObject shouldn't crash for a value that internally is represented as a non JSObjects values. Additional check was added to QScriptEnginePrivate::isQMetaObject. Reviewed-by: Kent Hansen --- src/script/api/qscriptengine_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index f69e537..79294fe 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -854,7 +854,7 @@ inline bool QScriptEnginePrivate::isQObject(JSC::JSValue value) inline bool QScriptEnginePrivate::isQMetaObject(JSC::JSValue value) { #ifndef QT_NO_QOBJECT - return JSC::asObject(value)->inherits(&QScript::QMetaObjectWrapperObject::info); + return isObject(value) && JSC::asObject(value)->inherits(&QScript::QMetaObjectWrapperObject::info); #else return false; #endif -- cgit v0.12