diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-02-24 13:46:10 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-02-24 13:46:10 (GMT) |
commit | 61f81db089f45fe56419bc4b695bdbb475b0684a (patch) | |
tree | 6f41e0d75044efc31e4cedc68e318c144c264a8b | |
parent | 3d25c963adadc5b0f8ae6282790aef11b5f6a9cc (diff) | |
download | Qt-61f81db089f45fe56419bc4b695bdbb475b0684a.zip Qt-61f81db089f45fe56419bc4b695bdbb475b0684a.tar.gz Qt-61f81db089f45fe56419bc4b695bdbb475b0684a.tar.bz2 |
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
-rw-r--r-- | src/script/api/qscriptengine_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |