From 27679824ff756279f035c4c7f11fe7dfacc25754 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 29 Jun 2018 00:16:32 +0100 Subject: 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). --- indra/newview/lllogininstance.cpp | 5 +++++ indra/newview/llviewernetwork.cpp | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bc93fa2c20..deef3dbce7 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -113,6 +113,11 @@ void LLLoginInstance::connect(LLPointer credentials) { std::vector 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); } 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::vectorasString()); - } + 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 { -- cgit v1.2.3