aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlglobal_p.h
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-06-12 17:47:15 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-12 14:10:24 +0200
commiteacbc7805e937e64b7e117705919b214aed4f736 (patch)
tree5416f535f54bf67920acc4c673586e982c024a7e /src/qml/qml/qqmlglobal_p.h
parent38540f6091c2ffedaea3afbf093d8079840c9ea2 (diff)
Check for null ptr in qmlobject_cast definition
Previously, the input object wasn't checked for nullness, and thus the qmlobject_cast could assert. Change-Id: I3552150953cef8411a860a381e28b1d681494b08 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r--src/qml/qml/qqmlglobal_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index b52e55c61b..c237af6a7c 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -158,7 +158,7 @@ QT_BEGIN_NAMESPACE
template<class T>
T qmlobject_cast(QObject *object)
{
- if (QQmlMetaObject::canConvert(object, &reinterpret_cast<T>(object)->staticMetaObject))
+ if (object && QQmlMetaObject::canConvert(object, &reinterpret_cast<T>(object)->staticMetaObject))
return static_cast<T>(object);
else
return 0;