From 90fc7a13d1ebf766f727f4709853d2a9bd4f2d4e Mon Sep 17 00:00:00 2001
From: Stinson Linden <stinson@lindenlab.com>
Date: Thu, 29 May 2014 21:08:21 +0100
Subject: [PATCH] MAINT-4106: Correcting crash on exit behavior during normal
 shutdown.  With the more comprehensive texture cleanup going on, this code
 was causing an crash on exit when gAgentAvatarp was null.  Adding a check for
 null before proceeding.

---
 indra/newview/llvoavatarself.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 319da1abb59..83e08ff1e8e 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2033,7 +2033,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const
 /*static*/
 void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
 {
-	gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+	if (gAgentAvatarp.notNull())
+	{
+		gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+	}
 }
 
 void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
-- 
GitLab