qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type
Date: Sat, 17 Oct 2009 09:55:31 +0200

Cc: Luiz Capitulino <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 qobject.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qobject.h b/qobject.h
index 4cc9287..200644d 100644
--- a/qobject.h
+++ b/qobject.h
@@ -102,6 +102,8 @@ static inline void qobject_decref(QObject *obj)
  */
 static inline qtype_code qobject_type(const QObject *obj)
 {
+    if (!obj)
+        return QTYPE_NONE;
     assert(obj->type != NULL);
     return obj->type->code;
 }
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]