From b100f1d2d43564cab5cebfbace66f14a9b7615df Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 1 Jun 2011 12:09:40 -0600
Subject: fix for STORM-1298: Crash on startup of Second Life 2.7.1(231307)

---
 indra/newview/lldrawpoolbump.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'indra/newview/lldrawpoolbump.cpp')

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 5f89d11391..2f76baaaf7 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -94,6 +94,13 @@ void LLStandardBumpmap::restoreGL()
 // static
 void LLStandardBumpmap::addstandard()
 {
+	if(!gTextureList.isInitialized())
+	{
+		//Note: loading pre-configuration sometimes triggers this call.
+		//But it is safe to return here because bump images will be reloaded during initialization later.
+		return ;
+	}
+
 	// can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup.  Sigh.  So clear the list every time before we (re-)add the standard bumpmaps.
 	//llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
 	clear();
@@ -891,6 +898,7 @@ void LLBumpImageList::restoreGL()
 {
 	if(!gTextureList.isInitialized())
 	{
+		//safe to return here because bump images will be reloaded during initialization later.
 		return ;
 	}
 
-- 
cgit v1.2.3