Skip to content
Snippets Groups Projects
Commit 75a66a14 authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

EXT-8727 FIXED Potential fix for a crash in LLAppearanceMgr::updateClothingOrderingInfo.

I couldn't reproduce the problem (it has happened for only two users, both running MacOSX),
but from what I see in the logs, it might have been caused by (or related to) NULL COF items.
I haven't found out how they appear nor what exactly causes the crash, but just for any
case I added a check to make sure we don't try to update wearables ordering info for such items.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/876/

--HG--
branch : product-engine
parent 19fb0a16
No related branches found
No related tags found
No related merge requests found
...@@ -115,6 +115,7 @@ void LLInitialWearablesFetch::processContents() ...@@ -115,6 +115,7 @@ void LLInitialWearablesFetch::processContents()
LLInventoryModel::cat_array_t cat_array; LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t wearable_array; LLInventoryModel::item_array_t wearable_array;
LLFindWearables is_wearable; LLFindWearables is_wearable;
llassert_always(mComplete.size() != 0);
gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array,
LLInventoryModel::EXCLUDE_TRASH, is_wearable); LLInventoryModel::EXCLUDE_TRASH, is_wearable);
......
...@@ -2307,12 +2307,17 @@ bool LLAppearanceMgr::updateBaseOutfit() ...@@ -2307,12 +2307,17 @@ bool LLAppearanceMgr::updateBaseOutfit()
void LLAppearanceMgr::divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type) void LLAppearanceMgr::divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type)
{ {
items_by_type.reserve(LLWearableType::WT_COUNT); items_by_type.resize(LLWearableType::WT_COUNT);
if (items.empty()) return; if (items.empty()) return;
for (S32 i=0; i<items.count(); i++) for (S32 i=0; i<items.count(); i++)
{ {
LLViewerInventoryItem *item = items.get(i); LLViewerInventoryItem *item = items.get(i);
if (!item)
{
LL_WARNS("Appearance") << "NULL item found" << llendl;
continue;
}
// Ignore non-wearables. // Ignore non-wearables.
if (!item->isWearableType()) if (!item->isWearableType())
continue; continue;
...@@ -2335,6 +2340,7 @@ std::string build_order_string(LLWearableType::EType type, U32 i) ...@@ -2335,6 +2340,7 @@ std::string build_order_string(LLWearableType::EType type, U32 i)
struct WearablesOrderComparator struct WearablesOrderComparator
{ {
LOG_CLASS(WearablesOrderComparator);
WearablesOrderComparator(const LLWearableType::EType type) WearablesOrderComparator(const LLWearableType::EType type)
{ {
mControlSize = build_order_string(type, 0).size(); mControlSize = build_order_string(type, 0).size();
......
...@@ -42,6 +42,8 @@ class LLOutfitUnLockTimer; ...@@ -42,6 +42,8 @@ class LLOutfitUnLockTimer;
class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr> class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
{ {
LOG_CLASS(LLAppearanceMgr);
friend class LLSingleton<LLAppearanceMgr>; friend class LLSingleton<LLAppearanceMgr>;
friend class LLOutfitUnLockTimer; friend class LLOutfitUnLockTimer;
......
...@@ -501,7 +501,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, ...@@ -501,7 +501,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
for(S32 i = 0; i < count; ++i) for(S32 i = 0; i < count; ++i)
{ {
item = item_array->get(i); item = item_array->get(i);
if (item->getActualType() == LLAssetType::AT_LINK_FOLDER) if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
{ {
LLViewerInventoryCategory *linked_cat = item->getLinkedCategory(); LLViewerInventoryCategory *linked_cat = item->getLinkedCategory();
if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT) if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment