summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index f1b54e0e01..286604e367 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4045,7 +4045,7 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry)
const LLUUID& image_id = getTE(te)->getID();
mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
- if (getTE(te)->getMaterialParams() != NULL)
+ if (getTE(te)->getMaterialParams().notNull())
{
const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID();
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, TRUE, LLViewerTexture::BOOST_BUMP, LLViewerTexture::LOD_TEXTURE);
@@ -4094,7 +4094,12 @@ S32 LLViewerObject::setTENormalMapCore(const U8 te, const LLUUID& uuid, LLHost h
// uuid == LLUUID::null)
{
retval = TEM_CHANGE_TEXTURE;
- getTE(te)->getMaterialParams()->setNormalID(uuid);
+ LLTextureEntry* tep = getTE(te);
+ LLMaterial* mat = tep->getMaterialParams();
+ if (mat)
+ {
+ mat->setNormalID(uuid);
+ }
mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(uuid, TRUE, LLViewerTexture::BOOST_BUMP, LLViewerTexture::LOD_TEXTURE, 0, 0, host);
setChanged(TEXTURE);
if (mDrawable.notNull())
@@ -4112,7 +4117,12 @@ S32 LLViewerObject::setTESpecularMapCore(const U8 te, const LLUUID& uuid, LLHost
// uuid == LLUUID::null)
{
retval = TEM_CHANGE_TEXTURE;
- getTE(te)->getMaterialParams()->setSpecularID(uuid);
+ LLTextureEntry* tep = getTE(te);
+ LLMaterial* mat = tep->getMaterialParams();
+ if (mat)
+ {
+ mat->setSpecularID(uuid);
+ }
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(uuid, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host);
setChanged(TEXTURE);
if (mDrawable.notNull())