From f247dc68df1ae1972a9bca14f774f9dcba75b12e Mon Sep 17 00:00:00 2001
From: Sergei Litovchuk <slitovchuk@productengine.com>
Date: Fri, 30 Apr 2010 19:48:15 +0300
Subject: [PATCH] Task (EXT-6722) Create modified inventory view for "my
 outfits" tab in top-level appearance sidebar - Fixed adding category check in
 LLInventoryCategoriesObserver.

Reviewed by Mike Antipov https://codereview.productengine.com/secondlife/r/332/

--HG--
branch : product-engine
---
 indra/newview/llinventoryobserver.cpp | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index 86147d65e6b..c24d2ee0eaf 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -689,7 +689,10 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
 			// Unrecoverable, so just skip this category.
 
 			llassert(cats != NULL && items != NULL);
+
+			continue;
 		}
+
 		const S32 current_num_known_descendents = cats->count() + items->count();
 
 		LLCategoryData cat_data = (*iter).second;
@@ -708,11 +711,15 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
 
 bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb)
 {
-	S32 version;
-	S32 current_num_known_descendents;
+	S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN;
+	S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
 	bool can_be_added = true;
 
 	LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
+	// If category could not be retrieved it might mean that
+	// inventory is unusable at the moment so the category is
+	// stored with VERSION_UNKNOWN and DESCENDENT_COUNT_UNKNOWN,
+	// it may be updated later.
 	if (category)
 	{
 		// Inventory category version is used to find out if some changes
@@ -732,16 +739,10 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
 
 			llassert(cats != NULL && items != NULL);
 		}
-		current_num_known_descendents = cats->count() + items->count();
-	}
-	else
-	{
-		// If category could not be retrieved it might mean that
-		// inventory is unusable at the moment so the category is
-		// stored with VERSION_UNKNOWN and DESCENDENT_COUNT_UNKNOWN,
-		// it may be updated later.
-		version = LLViewerInventoryCategory::VERSION_UNKNOWN;
-		current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
+		else
+		{
+			current_num_known_descendents = cats->count() + items->count();
+		}
 	}
 
 	if (can_be_added)
-- 
GitLab