summaryrefslogtreecommitdiff
path: root/indra/newview/lllocalbitmaps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lllocalbitmaps.cpp')
-rwxr-xr-xindra/newview/lllocalbitmaps.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 2c2e66e08f..1380345164 100755
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -64,6 +64,8 @@
#include "llimagedimensionsinfo.h"
#include "llviewercontrol.h"
#include "lltrans.h"
+#include "llviewerdisplay.h"
+
/*=======================================*/
/* Formal declarations, constants, etc. */
/*=======================================*/
@@ -543,12 +545,14 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp
LLAvatarAppearanceDefines::ETextureIndex reg_texind = getTexIndex(type, baked_texind);
if (reg_texind != LLAvatarAppearanceDefines::TEX_NUM_INDICES)
{
- U32 index = gAgentWearables.getWearableIndex(wearable);
- gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index);
- gAgentAvatarp->wearableUpdated(type);
-
- /* telling the manager to rebake once update cycle is fully done */
- LLLocalBitmapMgr::setNeedsRebake();
+ U32 index;
+ if (gAgentWearables.getWearableIndex(wearable,index))
+ {
+ gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index);
+ gAgentAvatarp->wearableUpdated(type);
+ /* telling the manager to rebake once update cycle is fully done */
+ LLLocalBitmapMgr::setNeedsRebake();
+ }
}
}