From 4b1ce391d4e9cd4139ffef65cf9071bed7f888d0 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 16 Jul 2009 23:22:18 +0000
Subject: [PATCH] make LLViewerTextureManager::staticCastToFetchedTexture to
 accept NULL pointer as input.

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

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 92e00e0cae6..a949830dcf7 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -156,6 +156,11 @@ LLViewerMediaTexture*  LLViewerTextureManager::getMediaTexture(const LLUUID& id,
 
 LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLViewerTexture* tex, BOOL report_error)
 {
+	if(!tex)
+	{
+		return NULL ;
+	}
+
 	S8 type = tex->getType() ;
 	if(type == LLViewerTexture::FETCHED_TEXTURE || type == LLViewerTexture::LOD_TEXTURE)
 	{
-- 
GitLab