Avoid AvNameCache log spam for NULL UUID

master
Beq 2021-02-07 17:20:15 +00:00
parent e0be68917b
commit 49039e66ea
3 changed files with 16 additions and 2 deletions

View File

@ -632,6 +632,13 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
// returns bool specifying if av_name was filled, false otherwise
bool LLAvatarNameCache::getName(const LLUUID& agent_id, LLAvatarName *av_name)
{
// <FS:Beq> Avoid null entries entering NameCache
// This is a catch-all, better to avoid at call site
if( agent_id.isNull() )
{
return false;
}
// </FS:Beq>
if (mRunning)
{
// ...only do immediate lookups when cache is running

View File

@ -258,7 +258,11 @@ std::string LLInvFVBridge::getSearchableCreatorName() const
if(item)
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name))
// <FS:Beq> Avoid null id requests entering name cache
// if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name))
const auto& creatorId {item->getCreatorUUID()};
if ( creatorId.notNull() && LLAvatarNameCache::get(creatorId, &av_name) )
// </FS:Beq>
{
std::string username = av_name.getUserName();
LLStringUtil::toUpper(username);

View File

@ -324,7 +324,10 @@ std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notifica
from_id = notification->getPayload()["from_id"];
}
LLAvatarName av_name;
if(LLAvatarNameCache::get(from_id, &av_name))
// <FS:Beq> Avoid null UUID name cache requests
// if(LLAvatarNameCache::get(from_id, &av_name))
if( from_id.notNull() && LLAvatarNameCache::get(from_id, &av_name) )
// </FS:Beq>
{
res = av_name.getUserName();
}