From 9a7f1e782c4939bf2027eead051a8925a92ef986 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 13 Oct 2017 16:12:15 +0300 Subject: MAINT-7902 Fixed Opening Marketplace Listing before inventory has fetched unlists listings --- indra/newview/llinventoryfunctions.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 67ddd79230..8b50e4248e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -264,7 +264,9 @@ void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistenc // is limited to 4. // We also take care of degenerated cases so we don't update all folders in the inventory by mistake. - if (cur_uuid.isNull()) + if (cur_uuid.isNull() + || gInventory.getCategory(cur_uuid) == NULL + || gInventory.getCategory(cur_uuid)->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { return; } @@ -275,9 +277,13 @@ void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistenc { // Retrieve the listing uuid this object is in LLUUID listing_uuid = nested_parent_id(cur_uuid, depth); + LLViewerInventoryCategory* listing_cat = gInventory.getCategory(listing_uuid); + bool listing_cat_loaded = listing_cat != NULL && listing_cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; // Verify marketplace data consistency for this listing - if (perform_consistency_enforcement && LLMarketplaceData::instance().isListed(listing_uuid)) + if (perform_consistency_enforcement + && listing_cat_loaded + && LLMarketplaceData::instance().isListed(listing_uuid)) { LLUUID version_folder_uuid = LLMarketplaceData::instance().getVersionFolder(listing_uuid); S32 version_depth = depth_nesting_in_marketplace(version_folder_uuid); @@ -299,7 +305,9 @@ void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistenc } // Check if the count on hand needs to be updated on SLM - if (perform_consistency_enforcement && (compute_stock_count(listing_uuid) != LLMarketplaceData::instance().getCountOnHand(listing_uuid))) + if (perform_consistency_enforcement + && listing_cat_loaded + && (compute_stock_count(listing_uuid) != LLMarketplaceData::instance().getCountOnHand(listing_uuid))) { LLMarketplaceData::instance().updateCountOnHand(listing_uuid,1); } -- cgit v1.2.3