From dd692f17ab12d44177253e9dde33c93e37caef5e Mon Sep 17 00:00:00 2001
From: Sergei Litovchuk <slitovchuk@productengine.com>
Date: Thu, 12 Aug 2010 15:56:51 +0300
Subject: EXT-8628 FIXED Crash in LLVOAvatarSelf::getAttachedPointName().

The crash was reproducible only on startup. Apparently, gAgentAvatarp was not valid at that point.
Worked around by checking gAgentAvatarp for being valid.

I didn't investigate what the root cause of the problem was (probably the new multi-attachments implementation), I just needed my viewer to work.

Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/847/.

--HG--
branch : product-engine
---
 indra/newview/llinventorybridge.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 38f3521b2d..9bbc6514b4 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3985,6 +3985,11 @@ std::string LLObjectBridge::getLabelSuffix() const
 {
 	if (get_is_item_worn(mUUID))
 	{
+		if (!isAgentAvatarValid())
+		{
+			return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn");
+		}
+
 		std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID);
 
 		// e.g. "(worn on ...)" / "(attached to ...)"
-- 
cgit v1.2.3