From 39a50b0face299bbcae2a63f3fd51a41f8bb35cd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 8 Feb 2023 21:41:43 +0200 Subject: SL-19134 Fix thumbnail ctrl not drawing an 'X' for empty texture --- indra/newview/llthumbnailctrl.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index 8f51f2c80d..4245237529 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -164,16 +164,19 @@ void LLThumbnailCtrl::setValue(const LLSD& value) if (tvalue.isUUID()) { mImageAssetID = tvalue.asUUID(); - // Should it support baked textures? - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + if (mImageAssetID.notNull()) + { + // Should it support baked textures? + mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - mTexturep->setBoostLevel(mPriority); - mTexturep->forceToSaveRawImage(0); - - S32 desired_draw_width = mTexturep->getWidth(); - S32 desired_draw_height = mTexturep->getHeight(); - - mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height); + mTexturep->setBoostLevel(mPriority); + mTexturep->forceToSaveRawImage(0); + + S32 desired_draw_width = mTexturep->getWidth(); + S32 desired_draw_height = mTexturep->getHeight(); + + mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height); + } } else if (tvalue.isString()) { -- cgit v1.2.3