summaryrefslogtreecommitdiff
path: root/indra/newview/llmarketplacefunctions.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-10-21 19:34:54 -0700
committerMerov Linden <merov@lindenlab.com>2014-10-21 19:34:54 -0700
commiteeb5fb382bdb45c4c886a113506b777e85cbf4e2 (patch)
tree4e950803121144f7b14b11319f4c5e17c993cfb5 /indra/newview/llmarketplacefunctions.cpp
parent511c77657963afa06819560b6eb2c4a6c224af72 (diff)
DD-221 : Pointer testing to avoid potential crash
Diffstat (limited to 'indra/newview/llmarketplacefunctions.cpp')
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index b4a2921f8c..4bf0eac03b 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1059,7 +1059,7 @@ void LLMarketplaceInventoryObserver::changed(U32 mask)
// once observers are called) we need to raise a flag in the inventory to signal that things have been dirtied.
// That's the only changes that really do make sense for marketplace to worry about
- if ((mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) != 0)
+ if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE))
{
const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
@@ -1068,24 +1068,27 @@ void LLMarketplaceInventoryObserver::changed(U32 mask)
for (;id_it != id_end; ++id_it)
{
LLInventoryObject* obj = gInventory.getObject(*id_it);
- if (LLAssetType::AT_CATEGORY == obj->getType())
+ if (obj)
{
- // If it's a folder known to the marketplace, let's check it's in proper shape
- if (LLMarketplaceData::instance().isListed(*id_it) || LLMarketplaceData::instance().isVersionFolder(*id_it))
+ if (LLAssetType::AT_CATEGORY == obj->getType())
{
- LLInventoryCategory* cat = (LLInventoryCategory*)(obj);
- validate_marketplacelistings(cat);
+ // If it's a folder known to the marketplace, let's check it's in proper shape
+ if (LLMarketplaceData::instance().isListed(*id_it) || LLMarketplaceData::instance().isVersionFolder(*id_it))
+ {
+ LLInventoryCategory* cat = (LLInventoryCategory*)(obj);
+ validate_marketplacelistings(cat);
+ }
}
- }
- else
- {
- // If it's not a category, it's an item...
- LLInventoryItem* item = (LLInventoryItem*)(obj);
- // If it's a no copy item, we may need to update the label count of marketplace listings
- if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+ else
{
- LLMarketplaceData::instance().setDirtyCount();
- }
+ // If it's not a category, it's an item...
+ LLInventoryItem* item = (LLInventoryItem*)(obj);
+ // If it's a no copy item, we may need to update the label count of marketplace listings
+ if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+ {
+ LLMarketplaceData::instance().setDirtyCount();
+ }
+ }
}
}
}