From f83601c180d3d30992cd3735e307da7bade64000 Mon Sep 17 00:00:00 2001
From: Loren Shih <seraph@lindenlab.com>
Date: Wed, 12 Aug 2009 19:53:45 +0000
Subject: [PATCH] For DEV-37866 : Crash when creating a new look b/c of
 non-existent attachments

Simple fix -- added NULL check to logic that processes attachments.
---
 indra/newview/llagentwearables.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index e5e456acb8a..4834b31bc74 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1182,7 +1182,7 @@ void LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name,
 					}
 
 					LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((EWearableType) type, j));
-					// BAP TODO
+					if (!item) continue;
 					LLPointer<LLInventoryCallback> cb = NULL;
 					link_inventory_item(gAgent.getID(),
 										item->getUUID(),
@@ -1214,7 +1214,6 @@ void LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name,
 			LLInventoryItem* item = gInventory.getItem(item_id);
 			if (!item) continue;
 
-			// BAP link here
 			LLPointer<LLInventoryCallback> cb = NULL;
 			link_inventory_item(gAgent.getID(),
 								item->getUUID(),
-- 
GitLab