From f5d22358d29905c2adbe0af1c8c453dd0a80b4e2 Mon Sep 17 00:00:00 2001
From: AndreyL ProductEngine <andreylproductengine@lindenlab.com>
Date: Tue, 28 Jul 2015 09:01:20 +0300
Subject: [PATCH] MAINT-5432 MAINT-5440 FIXED Crash in
 LLUUID::operator==(LLUUID const &) and  LLFolderView::removeSelectedItems()

---
 indra/llui/llfolderview.cpp            | 2 +-
 indra/newview/llinventoryfunctions.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 43ebb5eda23..3282c5f7269 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -730,7 +730,7 @@ void LLFolderView::removeSelectedItems()
 		// structures.
 		std::vector<LLFolderViewItem*> items;
 		S32 count = mSelectedItems.size();
-		if(count == 0) return;
+		if(count <= 0) return;
 		LLFolderViewItem* item = NULL;
 		selected_items_t::iterator item_it;
 		for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 0195b5efc11..218590e5c3d 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2620,7 +2620,8 @@ void LLInventoryAction::buildMarketplaceFolders(LLFolderView* root)
     for (; set_iter != selected_items.end(); ++set_iter)
     {
         viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
-        if (viewModel && gInventory.isObjectDescendentOf(viewModel->getInventoryObject()->getParentUUID(), marketplacelistings_id))
+        if (!viewModel || !viewModel->getInventoryObject()) continue;
+        if (gInventory.isObjectDescendentOf(viewModel->getInventoryObject()->getParentUUID(), marketplacelistings_id))
         {
             const LLUUID &parent_id = viewModel->getInventoryObject()->getParentUUID();
             if (parent_id != marketplacelistings_id)
-- 
GitLab