aboutsummaryrefslogtreecommitdiff
path: root/qobject/qint.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/qint.c')
-rw-r--r--qobject/qint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qobject/qint.c b/qobject/qint.c
index 86b9b04f0b..999688e9ce 100644
--- a/qobject/qint.c
+++ b/qobject/qint.c
@@ -50,9 +50,9 @@ int64_t qint_get_int(const QInt *qi)
*/
QInt *qobject_to_qint(const QObject *obj)
{
- if (qobject_type(obj) != QTYPE_QINT)
+ if (!obj || qobject_type(obj) != QTYPE_QINT) {
return NULL;
-
+ }
return container_of(obj, QInt, base);
}