summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-24 13:46:10 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-24 13:46:10 (GMT)
commit61f81db089f45fe56419bc4b695bdbb475b0684a (patch)
tree6f41e0d75044efc31e4cedc68e318c144c264a8b
parent3d25c963adadc5b0f8ae6282790aef11b5f6a9cc (diff)
downloadQt-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.h2
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