From 49039e66ea27e46ef2716fabc1f2231b8bca3763 Mon Sep 17 00:00:00 2001 From: Beq Date: Sun, 7 Feb 2021 17:20:15 +0000 Subject: [PATCH] Avoid AvNameCache log spam for NULL UUID --- indra/llmessage/llavatarnamecache.cpp | 7 +++++++ indra/newview/llinventorybridge.cpp | 6 +++++- indra/newview/llnotificationhandlerutil.cpp | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index a8e9a6bd64..795860e9f7 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -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) { + // Avoid null entries entering NameCache + // This is a catch-all, better to avoid at call site + if( agent_id.isNull() ) + { + return false; + } + // if (mRunning) { // ...only do immediate lookups when cache is running diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c1f6c2f167..aa37afe7eb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -258,7 +258,11 @@ std::string LLInvFVBridge::getSearchableCreatorName() const if(item) { LLAvatarName av_name; - if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) + // 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) ) + // { std::string username = av_name.getUserName(); LLStringUtil::toUpper(username); diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 4b231ca72b..3666ef7bc4 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -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)) + // Avoid null UUID name cache requests + // if(LLAvatarNameCache::get(from_id, &av_name)) + if( from_id.notNull() && LLAvatarNameCache::get(from_id, &av_name) ) + // { res = av_name.getUserName(); }