From e2f4b4ecc2cac710948bfa552c0c2ef3e316cabe Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 13 Jul 2011 13:16:14 +0200 Subject: [PATCH] protect against accessing a null --- declarativeimports/core/dialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/declarativeimports/core/dialog.cpp b/declarativeimports/core/dialog.cpp index be07a45d8..b377a45ee 100644 --- a/declarativeimports/core/dialog.cpp +++ b/declarativeimports/core/dialog.cpp @@ -153,8 +153,10 @@ void DialogProxy::syncMainItem() QGraphicsWidget *widget = qobject_cast(m_mainItem.data()); if (widget) { - m_declarativeItemContainer->deleteLater(); - m_declarativeItemContainer = 0; + if (m_declarativeItemContainer) { + m_declarativeItemContainer->deleteLater(); + m_declarativeItemContainer = 0; + } } else { QDeclarativeItem *di = qobject_cast(m_mainItem.data()); if (di) {