summaryrefslogtreecommitdiff
path: root/indra/newview/llviewernetwork.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-29 00:16:32 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-29 00:16:32 +0100
commit27679824ff756279f035c4c7f11fe7dfacc25754 (patch)
tree0a29392325371fdba03598089d2277c531df08e9 /indra/newview/llviewernetwork.cpp
parent0aa2e5b1a36f917512c054414d97c5a4d3a4d544 (diff)
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).
Diffstat (limited to 'indra/newview/llviewernetwork.cpp')
-rw-r--r--indra/newview/llviewernetwork.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 6937d064f9..0072baa02c 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -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
{