summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-12-13 23:22:22 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-12-14 14:21:40 +0200
commit009cd9adccd117357fa4054c523218a0e990bb80 (patch)
tree24cd51c02bc4b1ac1ae117490551585172d9f770 /indra/newview
parent5abcec163c46c2bcb06ba9703c717f0e037f087e (diff)
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.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventoryfunctions.cpp17
1 files changed, 17 insertions, 0 deletions
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<LLFolderViewItem*> 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)))