aboutsummaryrefslogtreecommitdiff
path: root/qobject/qfloat.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/qfloat.c')
-rw-r--r--qobject/qfloat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qobject/qfloat.c b/qobject/qfloat.c
index 7de0992dba..c86516327f 100644
--- a/qobject/qfloat.c
+++ b/qobject/qfloat.c
@@ -51,9 +51,9 @@ double qfloat_get_double(const QFloat *qf)
*/
QFloat *qobject_to_qfloat(const QObject *obj)
{
- if (qobject_type(obj) != QTYPE_QFLOAT)
+ if (!obj || qobject_type(obj) != QTYPE_QFLOAT) {
return NULL;
-
+ }
return container_of(obj, QFloat, base);
}