diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-10-13 16:12:15 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-10-13 16:12:15 +0300 |
commit | 9a7f1e782c4939bf2027eead051a8925a92ef986 (patch) | |
tree | d86a3e61df3ace1c5050d841e40d75e885ccd064 /indra | |
parent | c582029269d6eb60d50ac7af8cd3415c9448dd75 (diff) |
MAINT-7902 Fixed Opening Marketplace Listing before inventory has fetched unlists listings
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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); } |