mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 03:39:14 +00:00
Extra check in case of invalid index values.
This commit is contained in:
parent
b1451c4349
commit
670174004a
@ -58,6 +58,7 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment)
|
||||
raceList->setScrollVisible(true);
|
||||
raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||
raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||
raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||
|
||||
getWidget(skillList, "SkillList");
|
||||
getWidget(spellPowerList, "SpellPowerList");
|
||||
@ -134,6 +135,9 @@ void RaceDialog::onSelectNextHair(MyGUI::Widget*)
|
||||
|
||||
void RaceDialog::onSelectRace(MyGUI::List* _sender, size_t _index)
|
||||
{
|
||||
if (_index == MyGUI::ITEM_NONE)
|
||||
return;
|
||||
|
||||
const std::string race = raceList->getItem(_index);
|
||||
if (boost::iequals(currentRace, race))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user