From 478630d3380c24e757f001f601d5381cd34b577d Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 9 Oct 2019 22:37:13 +0200 Subject: [PATCH] Pull out local var to make sure it's lifetime (and thus the internal c_str() pointer) is longer than the if block. --- indra/newview/fsdiscordconnect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/fsdiscordconnect.cpp b/indra/newview/fsdiscordconnect.cpp index 4aa9921578..a4c8167ed4 100644 --- a/indra/newview/fsdiscordconnect.cpp +++ b/indra/newview/fsdiscordconnect.cpp @@ -206,10 +206,10 @@ void FSDiscordConnect::updateRichPresence() memset(&discordPresence, 0, sizeof(discordPresence)); discordPresence.state = region_name.c_str(); + std::string name; if (RlvActions::canShowName(RlvActions::SNC_DEFAULT, gAgentID) && gSavedPerAccountSettings.getBOOL("FSShareNameToDiscord")) { LLAvatarName av_name; - std::string name; if (LLAvatarNameCache::get(gAgentID, &av_name)) { name = av_name.getCompleteName(true, true);