summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/basiccontainer.cpp12
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())