diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 47201b2ccc..7168c33ce2 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -328,22 +328,26 @@ void LLInventoryPanel::modelChanged(U32 mask) // around in the panel's directory structure (i.e. reparented). if (model_item && view_item) { - LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); - - // Item has been moved. - if (view_item->getParentFolder() != new_parent) + // Don't process the item if it's hanging from the root, since its + // model_item's parent will be NULL. + if (view_item->getRoot() != view_item->getParent()) { - if (new_parent != NULL) - { - // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. - view_item->getParentFolder()->extractItem(view_item); - view_item->addToFolder(new_parent, mFolders); - } - else + LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); + // Item has been moved. + if (view_item->getParentFolder() != new_parent) { - // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that - // doesn't include trash). Just remove the item's UI. - view_item->destroyView(); + if (new_parent != NULL) + { + // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. + view_item->getParentFolder()->extractItem(view_item); + view_item->addToFolder(new_parent, mFolders); + } + else + { + // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that + // doesn't include trash). Just remove the item's UI. + view_item->destroyView(); + } } } } |