summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-07-20 17:16:22 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-07-20 17:16:22 +0300
commit3ae21b429e67faf4ee32c9387c63a552b883a472 (patch)
tree64ecf5f4bf855826dd47e82d20f51564456bd78f /indra/newview/llinventorypanel.cpp
parent7c9be0e3de6821478c71e4646f07fb112e0e572c (diff)
CHUI-207 FIXED Emptying Lost and Found and Trash in inventory crashes viewer
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 340f851ed8..6a7ee3b6a0 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -421,7 +421,14 @@ void LLInventoryPanel::modelChanged(U32 mask)
// LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item
// to folder is the fast way to get a folder without searching through folders tree.
- LLFolderViewFolder* view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
+ LLFolderViewFolder* view_folder = NULL;
+
+ // Check requires as this item might have already been deleted
+ // as a child of its deleted parent.
+ if (model_item && view_item)
+ {
+ view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
+ }
//////////////////////////////
// LABEL Operation
@@ -448,7 +455,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
if (mask & LLInventoryObserver::REBUILD)
{
handled = true;
- if (model_item && view_item)
+ if (model_item && view_item && viewmodel_item)
{
view_item->destroyView();
removeItemID(viewmodel_item->getUUID());
@@ -538,7 +545,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
//////////////////////////////
// REMOVE Operation
// This item has been removed from memory, but its associated UI element still exists.
- else if (!model_item && view_item)
+ else if (!model_item && view_item && viewmodel_item)
{
// Remove the item's UI.
removeItemID(viewmodel_item->getUUID());