diff options
author | Anchor Linden <anchor@lindenlab.com> | 2018-05-30 05:51:37 +0530 |
---|---|---|
committer | Anchor Linden <anchor@lindenlab.com> | 2018-05-30 05:51:37 +0530 |
commit | 71fa94b3665b4554470314f481c9f0a35f8e6ef2 (patch) | |
tree | 42c70f6b9df687aaf5e715060dde12b4f21ed22f /indra/newview | |
parent | 0a36c8d3be17032db20a9bdeff2b00ae2ed608a0 (diff) |
[MAINT-8693] - fix null check
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloateravatartextures.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerwearable.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 78807a8e99..8e654a53c4 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -78,7 +78,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp, { LLUUID id = IMG_DEFAULT_AVATAR; const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture(te); - if (tex_entry->mIsLocalTexture) + if (tex_entry && tex_entry->mIsLocalTexture) { if (avatarp->isSelf()) { @@ -96,7 +96,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp, } else { - id = avatarp->getTE(te)->getID(); + id = tex_entry ? avatarp->getTE(te)->getID() : IMG_DEFAULT_AVATAR; } //id = avatarp->getTE(te)->getID(); if (id == IMG_DEFAULT_AVATAR) diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index ae9ce37a28..2d7a0f920f 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -301,7 +301,7 @@ void LLViewerWearable::setTexturesToDefaults() LLUUID LLViewerWearable::getDefaultTextureImageID(ETextureIndex index) const { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - const std::string &default_image_name = texture_dict->mDefaultImageName; + const std::string &default_image_name = texture_dict ? texture_dict->mDefaultImageName : ""; if (default_image_name == "") { return IMG_DEFAULT_AVATAR; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7458c00b70..5eef48d735 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1007,7 +1007,7 @@ void LLVOAvatar::dumpBakedStatus() const ETextureIndex index = baked_dict->mTextureIndex; if (!inst->isTextureDefined(index)) { - LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName; + LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index) ? LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName : ""; } } LL_CONT << " ) " << inst->getUnbakedPixelAreaRank(); @@ -4715,7 +4715,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids) const if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - if (texture_dict->mIsLocalTexture) + if (texture_dict && texture_dict->mIsLocalTexture) { ids.insert(imagep->getID()); } @@ -4872,8 +4872,8 @@ void LLVOAvatar::updateTextures() if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - if (texture_dict->mIsLocalTexture) + const EBakedTextureIndex baked_index = texture_dict ? texture_dict->mBakedTextureIndex : EBakedTextureIndex::BAKED_NUM_INDICES; + if (texture_dict && texture_dict->mIsLocalTexture) { addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, mBakedTextureDatas[baked_index].mIsUsed); } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 00e72bfbff..b2954f4de2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2606,6 +2606,8 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) if( mUpperBodyLayerSet ) mUpperBodyLayerSet->requestUpdate(); */ const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); + if (!texture_dict) + return; if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) return; const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -2622,7 +2624,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const case TEX_HEAD_BODYPAINT: return mHeadLayerSet; */ const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - if (texture_dict->mIsUsedByBakedTexture) + if (texture_dict && texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return getLayerSet(baked_index); |