Fixed crash in ListWidget::getSelectionInternalName when nothing is selected
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8464 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
e6168f8ad7
commit
1fb5469cb3
@ -144,6 +144,7 @@ void ListWidget::renameItem(const int itemID, const irr::core::stringw newName,
|
||||
|
||||
std::string ListWidget::getSelectionInternalName()
|
||||
{
|
||||
if (getSelectionID() == -1) return "";
|
||||
return m_items[ getSelectionID() ].m_internal_name;
|
||||
|
||||
}
|
||||
|
@ -132,7 +132,10 @@ void AddonsScreen::eventCallback(GUIEngine::Widget* widget,
|
||||
getWidget<GUIEngine::ListWidget>("list_addons");
|
||||
std::string id = list->getSelectionInternalName();
|
||||
|
||||
new AddonsLoading(0.8f, 0.8f, id);
|
||||
if (!id.empty())
|
||||
{
|
||||
new AddonsLoading(0.8f, 0.8f, id);
|
||||
}
|
||||
}
|
||||
if (name == "category")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user