aboutsummaryrefslogtreecommitdiff
path: root/qobject/qbool.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/qbool.c')
-rw-r--r--qobject/qbool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qobject/qbool.c b/qobject/qbool.c
index 5ff69f0b2d..bc6535fa49 100644
--- a/qobject/qbool.c
+++ b/qobject/qbool.c
@@ -51,9 +51,9 @@ bool qbool_get_bool(const QBool *qb)
*/
QBool *qobject_to_qbool(const QObject *obj)
{
- if (qobject_type(obj) != QTYPE_QBOOL)
+ if (!obj || qobject_type(obj) != QTYPE_QBOOL) {
return NULL;
-
+ }
return container_of(obj, QBool, base);
}