diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-27 01:07:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-27 01:07:26 +0300 |
commit | 8e3641061a44cd9a78ff32b7840ee2f866ed8206 (patch) | |
tree | d9f288bfa0d33e751582eebb535d4760abc16073 /src | |
parent | 9452e1a39fe74b56b8667b088b9674358dcb52a2 (diff) | |
download | manaverse-8e3641061a44cd9a78ff32b7840ee2f866ed8206.tar.gz manaverse-8e3641061a44cd9a78ff32b7840ee2f866ed8206.tar.bz2 manaverse-8e3641061a44cd9a78ff32b7840ee2f866ed8206.tar.xz manaverse-8e3641061a44cd9a78ff32b7840ee2f866ed8206.zip |
Fix adding possible null pointer to window.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/basiccontainer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/basiccontainer.cpp b/src/gui/widgets/basiccontainer.cpp index faf89f731..92611687d 100644 --- a/src/gui/widgets/basiccontainer.cpp +++ b/src/gui/widgets/basiccontainer.cpp @@ -63,6 +63,7 @@ #include "gui/widgets/basiccontainer.h" +#include "utils/checkutils.h" #include "utils/foreach.h" #include "render/graphics.h" @@ -79,6 +80,12 @@ BasicContainer::~BasicContainer() void BasicContainer::moveToTop(Widget *const widget) restrict2 { + if (widget == nullptr) + { + reportAlways("BasicContainer::moveToTop empty widget."); + return; + } + FOR_EACH (WidgetListIterator, iter, mWidgets) { if (*iter == widget) @@ -101,6 +108,11 @@ void BasicContainer::moveToTop(Widget *const widget) restrict2 void BasicContainer::moveToBottom(Widget *const widget) restrict2 { + if (widget == nullptr) + { + reportAlways("BasicContainer::moveToBottom empty widget."); + return; + } const WidgetListIterator iter = std::find(mWidgets.begin(), mWidgets.end(), widget); if (iter != mWidgets.end()) |