Pull out local var to make sure it's lifetime (and thus the internal c_str() pointer) is longer than the if block.

meow-7.2.2
Nicky 2019-10-09 22:37:13 +02:00
parent 1d94fc7ce6
commit 478630d338
1 changed files with 1 additions and 1 deletions

View File

@ -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);