Fix nullptr crash in LLLandmarksPanel::canItemBeModified

master
Rye Mutt 2024-07-22 11:00:58 -04:00 committed by Andrey Kleshchev
parent 68316fd0fd
commit 8de48c4260
1 changed files with 4 additions and 4 deletions

View File

@ -959,12 +959,12 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
// then ask LLFolderView permissions
LLFolderView* root_folder = mCurrentSelectedList->getRootFolder();
LLFolderView* root_folder = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr;
if ("copy" == command_name)
{
// we shouldn't be able to copy folders from My Inventory Panel
return can_be_modified && root_folder->canCopy();
return can_be_modified && root_folder && root_folder->canCopy();
}
else if ("collapse" == command_name)
{
@ -981,7 +981,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
if ("cut" == command_name)
{
can_be_modified = root_folder->canCut();
can_be_modified = root_folder && root_folder->canCut();
}
else if ("rename" == command_name)
{
@ -993,7 +993,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
}
else if("paste" == command_name)
{
can_be_modified = root_folder->canPaste();
can_be_modified = root_folder && root_folder->canPaste();
}
else
{