From d0632598632465850568789ce2d00dcc325e5ebe Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 3 Mar 2010 16:41:17 -0800 Subject: Work around bad usernames occasionally sent from server. --- indra/llmessage/llcachename.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 8575332392..d7d49eac8d 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -891,8 +891,21 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - std::string full_name = - LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + // NOTE: Very occasionally the server sends down a full name + // in the first name field with an empty last name, for example, + // first = "Ladanie1 Resident", last = "". + // I cannot reproduce this, nor can I find a bug in the server code. + // Ensure "Resident" does not appear via cleanFullName, because + // buildFullName only checks last name. JC + std::string full_name; + if (entry->mLastName.empty()) + { + full_name = cleanFullName(entry->mFirstName); + } + else + { + full_name = LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + } mSignal(id, full_name, false); mReverseCache[full_name] = id; } -- cgit v1.2.3