From 233f2b564e7707f79deb493444f28363ac10bfd4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Jun 2015 01:38:17 +0300 Subject: Add missing checks on nonnull attributes to widgets. --- src/gui/widgets/basiccontainer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui/widgets/basiccontainer.cpp') 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; -- cgit v1.2.3-70-g09d2