From 402490c2f3b8e6d7863f4561acedcbc794ad7e73 Mon Sep 17 00:00:00 2001 From: Angeldark Raymaker Date: Thu, 2 Jan 2025 20:39:26 +0000 Subject: [PATCH 1/2] FIRE-34968: Null-check gAgentAvatarp before start/stop posing self --- indra/newview/fsfloaterposer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/fsfloaterposer.cpp b/indra/newview/fsfloaterposer.cpp index 23e34adf3b..1077d3e0f0 100644 --- a/indra/newview/fsfloaterposer.cpp +++ b/indra/newview/fsfloaterposer.cpp @@ -818,6 +818,9 @@ void FSFloaterPoser::loadPoseFromXml(LLVOAvatar* avatar, const std::string& pose void FSFloaterPoser::startPosingSelf() { + if (!gAgentAvatarp || gAgentAvatarp.isNull()) + return; + setUiSelectedAvatar(gAgentAvatarp->getID()); LLVOAvatar* avatar = getAvatarByUuid(gAgentAvatarp->getID()); if (!avatar) @@ -832,6 +835,9 @@ void FSFloaterPoser::startPosingSelf() void FSFloaterPoser::stopPosingSelf() { + if (!gAgentAvatarp || gAgentAvatarp.isNull()) + return; + LLVOAvatar* avatar = getAvatarByUuid(gAgentAvatarp->getID()); if (!avatar) return; From 75d368f45239a292b2090fead991caaab6383f7b Mon Sep 17 00:00:00 2001 From: Angeldark Raymaker Date: Mon, 13 Jan 2025 20:04:35 +0000 Subject: [PATCH 2/2] FIRE-34968: Fix user pose directory creation --- indra/newview/fsfloaterposer.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/fsfloaterposer.cpp b/indra/newview/fsfloaterposer.cpp index 634630092e..75dbb830e1 100644 --- a/indra/newview/fsfloaterposer.cpp +++ b/indra/newview/fsfloaterposer.cpp @@ -341,8 +341,8 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() std::string userPath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY); - userPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY); - if (gDirUtilp->fileExists(userPath)) + std::string userHandPresetsPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY); + if (gDirUtilp->fileExists(userHandPresetsPath)) return; try @@ -353,8 +353,11 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() LLFile::mkdir(userPath); } - LL_WARNS("Poser") << "Couldn't find folder: " << userPath << " - creating one." << LL_ENDL; - LLFile::mkdir(userPath); + if (!gDirUtilp->fileExists(userHandPresetsPath)) + { + LL_WARNS("Poser") << "Couldn't find folder: " << userHandPresetsPath << " - creating one." << LL_ENDL; + LLFile::mkdir(userHandPresetsPath); + } std::string sourcePresetPath = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, POSE_SAVE_SUBDIRECTORY, std::string(POSE_PRESETS_HANDS_SUBDIRECTORY)); @@ -366,10 +369,10 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() for (auto pose : posesToCopy) { std::string source = sourcePresetPath + gDirUtilp->getDirDelimiter() + pose; - std::string destination = userPath + gDirUtilp->getDirDelimiter() + pose; + std::string destination = userHandPresetsPath + gDirUtilp->getDirDelimiter() + pose; if (!LLFile::copy(source, destination)) - LL_WARNS("LLDiskCache") << "Failed to copy " << source << " to " << destination << LL_ENDL; + LL_WARNS("Poser") << "Failed to copy " << source << " to " << destination << LL_ENDL; } } catch (const std::exception& e)