summaryrefslogtreecommitdiff
path: root/src/gui/widgets/basiccontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-24 01:38:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 15:07:14 +0300
commit233f2b564e7707f79deb493444f28363ac10bfd4 (patch)
treeee9d960c24e68f7ce9da05ee9a0333a74615565d /src/gui/widgets/basiccontainer.cpp
parent1498a699f89f7b5aebdc4629c645c3702ee04f92 (diff)
downloadplus-233f2b564e7707f79deb493444f28363ac10bfd4.tar.gz
plus-233f2b564e7707f79deb493444f28363ac10bfd4.tar.bz2
plus-233f2b564e7707f79deb493444f28363ac10bfd4.tar.xz
plus-233f2b564e7707f79deb493444f28363ac10bfd4.zip
Add missing checks on nonnull attributes to widgets.
Diffstat (limited to 'src/gui/widgets/basiccontainer.cpp')
-rw-r--r--src/gui/widgets/basiccontainer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/widgets/basiccontainer.cpp b/src/gui/widgets/basiccontainer.cpp
index 1be1d4bc0..ea0a28bd8 100644
--- a/src/gui/widgets/basiccontainer.cpp
+++ b/src/gui/widgets/basiccontainer.cpp
@@ -240,6 +240,8 @@ void BasicContainer::setFocusHandler(FocusHandler *const focusHandler)
void BasicContainer::add(Widget *const widget)
{
+ if (!widget)
+ return;
mWidgets.push_back(widget);
if (widget->isAllowLogic())
mLogicWidgets.push_back(widget);
@@ -255,6 +257,8 @@ void BasicContainer::add(Widget *const widget)
void BasicContainer::remove(Widget* widget)
{
+ if (!widget)
+ return;
FOR_EACH (WidgetListIterator, iter, mWidgets)
{
if (*iter == widget)
@@ -382,6 +386,9 @@ void BasicContainer::logicChildren()
void BasicContainer::showWidgetPart(Widget *const widget, const Rect &area)
{
+ if (!widget)
+ return;
+
const Rect widgetArea = getChildrenArea();
const int x = widget->mDimension.x;