summaryrefslogtreecommitdiff
path: root/src/gui/widgets/setuptabscroll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/setuptabscroll.cpp')
-rw-r--r--src/gui/widgets/setuptabscroll.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp
index c3fd4dee8..805c0c8c7 100644
--- a/src/gui/widgets/setuptabscroll.cpp
+++ b/src/gui/widgets/setuptabscroll.cpp
@@ -61,14 +61,18 @@ SetupTabScroll::~SetupTabScroll()
void SetupTabScroll::addControl(SetupItem *widget)
{
- std::map<std::string, SetupItem*>::iterator iter
- = mItems.find(widget->getActionEventId());
- if (iter != mItems.end())
+ const std::string actionId = widget->getActionEventId();
+ if (!actionId.empty())
{
- delete (*iter).second;
- mItems.erase(iter);
+ std::map<std::string, SetupItem*>::iterator iter
+ = mItems.find(actionId);
+ if (iter != mItems.end())
+ {
+ delete (*iter).second;
+ mItems.erase(iter);
+ }
+ mItems[widget->getActionEventId()] = widget;
}
- mItems[widget->getActionEventId()] = widget;
mAllItems.insert(widget);
}