From 20bdbd487e9c64ce553ad68d467b1100342fe6a1 Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Mon, 9 Aug 2010 21:14:07 +0300
Subject: [PATCH] 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 7e710ce8e1d..53622f71887 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3989,6 +3989,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 ...)"
-- 
GitLab