aboutsummaryrefslogtreecommitdiff
path: root/qobject/qstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/qstring.c')
-rw-r--r--qobject/qstring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qobject/qstring.c b/qobject/qstring.c
index 607b7a142c..cb72dfbfc8 100644
--- a/qobject/qstring.c
+++ b/qobject/qstring.c
@@ -117,9 +117,9 @@ void qstring_append_chr(QString *qstring, int c)
*/
QString *qobject_to_qstring(const QObject *obj)
{
- if (qobject_type(obj) != QTYPE_QSTRING)
+ if (!obj || qobject_type(obj) != QTYPE_QSTRING) {
return NULL;
-
+ }
return container_of(obj, QString, base);
}