diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index f7ae320a6fc9f29f7740c93c8c3ed1157fb1cf00..1edc96e1652200861bc4e909d2888b19d2a3cd9b 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -115,6 +115,7 @@ void LLInitialWearablesFetch::processContents()
 	LLInventoryModel::cat_array_t cat_array;
 	LLInventoryModel::item_array_t wearable_array;
 	LLFindWearables is_wearable;
+	llassert_always(mComplete.size() != 0);
 	gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, 
 									LLInventoryModel::EXCLUDE_TRASH, is_wearable);
 
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 94286fd799f8b120ce17d13066ae5aa6830345d1..7159d89d21d09b201e214794a6e4d9928977e5f2 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2307,12 +2307,17 @@ bool LLAppearanceMgr::updateBaseOutfit()
 
 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;
 
 	for (S32 i=0; i<items.count(); i++)
 	{
 		LLViewerInventoryItem *item = items.get(i);
+		if (!item)
+		{
+			LL_WARNS("Appearance") << "NULL item found" << llendl;
+			continue;
+		}
 		// Ignore non-wearables.
 		if (!item->isWearableType())
 			continue;
@@ -2335,6 +2340,7 @@ std::string build_order_string(LLWearableType::EType type, U32 i)
 
 struct WearablesOrderComparator
 {
+	LOG_CLASS(WearablesOrderComparator);
 	WearablesOrderComparator(const LLWearableType::EType type)
 	{
 		mControlSize = build_order_string(type, 0).size();
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 78c2142ea563b52f2d37b137726a243110966d12..c65d9dc9eeda8448d3c3042fb336a14d2d095fa4 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -42,6 +42,8 @@ class LLOutfitUnLockTimer;
 
 class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
 {
+	LOG_CLASS(LLAppearanceMgr);
+
 	friend class LLSingleton<LLAppearanceMgr>;
 	friend class LLOutfitUnLockTimer;
 	
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 08229d3a50d00a4bfab48bad8043e23495b194c6..53835f0166ebed6a4cb51644243d84661d3f8527 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -501,7 +501,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
 		for(S32 i = 0; i < count; ++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();
 				if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT)