summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-07-01 20:07:56 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-07-01 20:07:56 +0300
commit2cde11b7baba1cb373af7c669339f85dfefb8b76 (patch)
tree171cfe17fae3856a763fbf5db0305d6ec7807340 /indra/newview/llinventoryfunctions.cpp
parentd7702f47e83918282d0180d80785649987986fd5 (diff)
MAINT-2864 FIXED Viewer crashes when clicking "Ok" on "Delete Selected Item" modal from a non existant object.
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 4075c329b9..58cab8a058 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -674,6 +674,19 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold
open_outbox();
}
+static void items_removal_confirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0 && !root.isDead() && !root.get()->isDead())
+ {
+ LLFolderView* folder_root = root.get();
+ //Need to remove item from DND before item is removed from root folder view
+ //because once removed from root folder view the item is no longer a selected item
+ LLInventoryAction::removeItemFromDND(folder_root);
+ folder_root->removeSelectedItems();
+ }
+}
+
///----------------------------------------------------------------------------
/// LLInventoryCollectFunctor implementations
///----------------------------------------------------------------------------
@@ -1072,7 +1085,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
{
LLSD args;
args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem");
- LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root));
+ LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&items_removal_confirmation, _1, _2, root->getHandle()));
return;
}
if (("copy" == action) || ("cut" == action))
@@ -1178,15 +1191,3 @@ void LLInventoryAction::removeItemFromDND(LLFolderView* root)
}
}
}
-
-void LLInventoryAction::onItemsRemovalConfirmation( const LLSD& notification, const LLSD& response, LLFolderView* root )
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (option == 0)
- {
- //Need to remove item from DND before item is removed from root folder view
- //because once removed from root folder view the item is no longer a selected item
- removeItemFromDND(root);
- root->removeSelectedItems();
- }
-}