summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventoryfunctions.cpp14
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);
}