From b9397343939df8f0ecd065d11624de74f344577f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 20 Mar 2015 13:42:03 -0700 Subject: DD-324 : Fix crash when recursively wrapping no copy items in stock folders --- indra/newview/llinventoryfunctions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 6e142d8998..1a7b804d44 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1764,8 +1764,10 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ { LLNotificationsUtil::add("AlertMerchantStockFolderSplit"); } - // If we have more than 1 type of items or we are at the listing level, wrap the items in subfolders - if ((count > 1) || (depth == 1)) + // If we have more than 1 type of items or we are at the listing level or we have stok/no stock type mismatch, wrap the items in subfolders + if ((count > 1) || (depth == 1) || + ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (type == LLInventoryType::IT_COUNT)) || + ((folder_type != LLFolderType::FT_MARKETPLACE_STOCK) && (type != LLInventoryType::IT_COUNT))) { // Create one folder per vector at the right depth and of the right type for (S32 i = 0; i <= LLInventoryType::IT_COUNT; i++) @@ -1819,7 +1821,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ { LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (*iter); gInventory.changeCategoryParent(viewer_cat, parent_uuid, false); - // Note : those reparented folders will be recursively visited and validated at the end of this function + result &= validate_marketplacelistings(viewer_cat, cb, fix_hierarchy, depth); } } } -- cgit v1.2.3