diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 70bfc6752316ee115b984f9dbaceeea4a35ca808..55609621b3ac967bd94bc1f44ed8a6c16b27a084 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2689,13 +2689,16 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 		const LLTextureEntry* te = face->getTextureEntry();
 		const LLViewerTexture* img = face->getTexture();
 
-		textures.insert(img->getID());
+		if (img)
+		{
+			textures.insert(img->getID());
+		}
 
 		if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
 		{
 			alpha++;
 		}
-		else if (img->getPrimaryFormat() == GL_ALPHA)
+		else if (img && img->getPrimaryFormat() == GL_ALPHA)
 		{
 			invisi = 1;
 		}