Replace hope and asserts with checks in LLFace::setTexture in hopes of side-stepping media texture crash.
meow-7.2.2
Graham Linden 2019-01-30 08:54:29 -08:00
parent acbc7f4cdd
commit 12cd42221e
1 changed files with 9 additions and 5 deletions

View File

@ -389,16 +389,20 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
return;
}
llassert(mTexture[ch].notNull());
new_texture->addTextureStats(mTexture[ch]->getMaxVirtualSize()) ;
if (mTexture[ch].notNull())
{
new_texture->addTextureStats(mTexture[ch]->getMaxVirtualSize()) ;
}
if (ch == LLRender::DIFFUSE_MAP)
{
getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
if (getViewerObject())
{
getViewerObject()->changeTEImage(mTEOffset, new_texture);
}
}
setTexture(ch, new_texture) ;
setTexture(ch, new_texture);
dirtyTexture();
}