summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-05-12 09:05:32 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-05-12 09:05:32 (GMT)
commit877bb2132bdd94a62526a5fea6a7e5f6f813395e (patch)
tree81dbe27caba2cff8341ab42ed5db4f735014b099 /src
parent1f854897da1231594d916ca3b094fcc59e43e8eb (diff)
downloadQt-877bb2132bdd94a62526a5fea6a7e5f6f813395e.zip
Qt-877bb2132bdd94a62526a5fea6a7e5f6f813395e.tar.gz
Qt-877bb2132bdd94a62526a5fea6a7e5f6f813395e.tar.bz2
QWidgetPrivate::setParent_sys might be using null pointer
Fix possible null pointer usage. Issue found by Coverity tool. Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 1dd1477..8ca29cd 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -782,7 +782,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
adjustFlags(data.window_flags, q);
// keep compatibility with previous versions, we need to preserve the created state
// (but we recreate the winId for the widget being reparented, again for compatibility)
- if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created)))
+ if (wasCreated || (!q->isWindow() && parent && parent->testAttribute(Qt::WA_WState_Created)))
createWinId();
if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
q->setAttribute(Qt::WA_WState_Hidden);