From patchwork Sat Oct 17 07:55:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/7] allow passing NULL to qobject_type Date: Fri, 16 Oct 2009 21:55:31 -0000 From: Paolo Bonzini X-Patchwork-Id: 36291 Message-Id: <1255766136-3028-3-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Cc: Luiz Capitulino Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- 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; }