From d2e242ab632a051e0b357efa1fdd0a1a64027f44 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Mon, 16 May 2022 18:28:06 +0300
Subject: [PATCH] SL-17412 Crash at isWearingWearableType

Related to "Allow Select Avatar" feature, selection manager made avatar to persist longer.
---
 indra/newview/llvoavatar.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c5c1c3b57a6..df34dda65eb 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -763,6 +763,13 @@ std::string LLVOAvatar::avString() const
 
 void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment)
 {
+    if (gDisconnected)
+    {
+        // If we disconected, these values are likely to be invalid and
+        // avString() might crash due to a dead sAvatarDictionary
+        return;
+    }
+
 	LL_INFOS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32()
 					   << "sec ]"
 					   << avString() 
-- 
GitLab