FIRE-29603, FIRE-29567: Fix crash when AO floater is open at login and AO Set is not loaded yet, and fix crash when creating the very first AO set
parent
2251be7f79
commit
f8e45f521e
|
|
@ -131,12 +131,6 @@ void FloaterAO::updateList()
|
|||
mReloadButton->setEnabled(TRUE);
|
||||
mImportRunning = FALSE;
|
||||
|
||||
std::string currentSetName = mSetSelector->getSelectedItemLabel();
|
||||
if (currentSetName.empty())
|
||||
{
|
||||
currentSetName = AOEngine::instance().getCurrentSetName();
|
||||
}
|
||||
|
||||
// Lambda provides simple Alpha sorting, note this is case sensitive.
|
||||
auto sortRuleLambda = [](const AOSet* s1, const AOSet* s2) -> bool
|
||||
{
|
||||
|
|
@ -146,6 +140,9 @@ void FloaterAO::updateList()
|
|||
mSetList=AOEngine::instance().getSetList();
|
||||
std::sort(mSetList.begin(), mSetList.end(), sortRuleLambda);
|
||||
|
||||
// remember currently selected animation set name
|
||||
std::string currentSetName = mSetSelector->getSelectedItemLabel();
|
||||
|
||||
mSetSelector->removeall();
|
||||
mSetSelectorSmall->removeall();
|
||||
mSetSelector->clear();
|
||||
|
|
@ -166,6 +163,21 @@ void FloaterAO::updateList()
|
|||
return;
|
||||
}
|
||||
|
||||
// make sure we have an animation set name to display
|
||||
if (currentSetName.empty())
|
||||
{
|
||||
// selected animation set was empty, get the currently active animation set from the engine
|
||||
currentSetName = AOEngine::instance().getCurrentSetName();
|
||||
LL_DEBUGS("AOEngine") << "Current set name was empty, fetched name \"" << currentSetName << "\" from AOEngine" << LL_ENDL;
|
||||
|
||||
if(currentSetName.empty())
|
||||
{
|
||||
// selected animation set was empty, get the name of the first animation set in the list
|
||||
currentSetName = mSetList[0]->getName();
|
||||
LL_DEBUGS("AOEngine") << "Current set name still empty, fetched first set's name \"" << currentSetName << "\"" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
for (U32 index = 0; index < mSetList.size(); ++index)
|
||||
{
|
||||
std::string setName = mSetList[index]->getName();
|
||||
|
|
|
|||
Loading…
Reference in New Issue