From 5bfa73a12ef1fe4b8dff1a730fec6346b5835e34 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Thu, 22 Oct 2020 18:05:33 +0300
Subject: [PATCH] SL-14161 FIXED an item persists in inventory after dragging
 it to the marketplace listings

---
 indra/newview/llinventorypanel.cpp | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 277dfe9e280..f96750fb0b1 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1053,7 +1053,6 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
 		
 		if(items)
         {
-            bool has_items = parentp->getItemsCount() > 0;
 			for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin();
 				 item_iter != items->end();
 				 ++item_iter)
@@ -1061,19 +1060,14 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
 				const LLViewerInventoryItem* item = (*item_iter);
                 if (typedViewsFilter(item->getUUID(), item))
                 {
-                    if (has_items)
-                    {
-                        // This can be optimized: we don't need to call getItemByID()
-                        // each time, especially since content is growing, we can just
-                        // iter over copy of mItemMap in some way
-                        LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
-                        buildViewsTree(item->getUUID(), id, item, view_itemp, parentp);
-                    }
-                    else
-                    {
-                        buildViewsTree(item->getUUID(), id, item, NULL, parentp);
-                    }
+
+                    // This can be optimized: we don't need to call getItemByID()
+                    // each time, especially since content is growing, we can just
+                    // iter over copy of mItemMap in some way
+                    LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
+                    buildViewsTree(item->getUUID(), id, item, view_itemp, parentp);
                 }
+
 			}
 		}
 		mInventory->unlockDirectDescendentArrays(id);
-- 
GitLab