From 009cd9adccd117357fa4054c523218a0e990bb80 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 13 Dec 2023 23:22:22 +0200 Subject: SL-20729 Crash in getObject in "new_folder_from_selected" at gInventory.getObject(*ids.begin()); according to bugsplat argument id was a null pointer so I assume there was an issue geting id out of the list. --- indra/newview/llinventoryfunctions.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 4aeacae6ed..6ac8bbee76 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2949,6 +2949,23 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids) void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm) { std::set selected_items = root->getSelectionList(); + if (selected_items.empty() + && action != "wear" + && action != "wear_add" + && !isRemoveAction(action)) + { + // Was item removed while user was checking menu? + // "wear" and removal exlusions are due to use of + // getInventorySelectedUUIDs() below + LL_WARNS("Inventory") << "Menu tried to operate on empty selection" << LL_ENDL; + + if (("copy" == action) || ("cut" == action)) + { + LLClipboard::instance().reset(); + } + + return; + } // Prompt the user and check for authorization for some marketplace active listing edits if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) -- cgit v1.2.3 From ba74152c823563a66729ea0a7fb7cab5bf58980d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 9 Jan 2024 00:16:52 +0100 Subject: Replace BOOST_FOREACH with standard C++ range-based for-loops --- indra/newview/llinventoryfunctions.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 6ac8bbee76..eb979335f8 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -91,8 +91,6 @@ #include "llvoavatarself.h" #include "llwearablelist.h" -#include - BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; std::list LLInventoryAction::sMarketplaceFolders; -- cgit v1.2.3