Skip to content
Snippets Groups Projects
Commit 27679824 authored by Graham Linden's avatar Graham Linden
Browse files

Handle grids.xml w/ single entry instead of an array.

Fix crash when no login URIs are found for a given grid
(does not happen after fixing above, but should not crash either).
parent 0aa2e5b1
No related branches found
No related tags found
No related merge requests found
......@@ -113,6 +113,11 @@ void LLLoginInstance::connect(LLPointer<LLCredential> credentials)
{
std::vector<std::string> uris;
LLGridManager::getInstance()->getLoginURIs(uris);
if (uris.size() < 1)
{
LL_WARNS() << "Failed to get login URIs during connect. No connect for you!" << LL_ENDL;
return;
}
connect(uris.front(), credentials);
}
......
......@@ -484,12 +484,19 @@ void LLGridManager::getLoginURIs(const std::string& grid, std::vector<std::strin
std::string grid_name = getGrid(grid);
if (!grid_name.empty())
{
for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray();
llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray();
llsd_uri++)
{
uris.push_back(llsd_uri->asString());
}
if (mGridList[grid_name][GRID_LOGIN_URI_VALUE].isArray())
{
for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray();
llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray();
llsd_uri++)
{
uris.push_back(llsd_uri->asString());
}
}
else
{
uris.push_back(mGridList[grid_name][GRID_LOGIN_URI_VALUE].asString());
}
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment