Guard against null-pointer crash

meow-7.2.2
Ansariel 2020-01-02 11:30:33 +01:00
parent 6b9aebb105
commit 0015cfae78
1 changed files with 11 additions and 8 deletions

View File

@ -10771,18 +10771,21 @@ void LLVOAvatar::updateRegion(LLViewerRegion *regionp)
//<FS:Beq> BOM constrain number of bake requests when BOM not supported,
// TEX_HEAD_TATTOO and BAKED_LEFT_ARM are the first new entries
sMaxBakes = gAgent.getRegion()->bakesOnMeshEnabled()?BAKED_NUM_INDICES:BAKED_LEFT_ARM;
if(!gSavedSettings.getBOOL("CurrentlyUsingBakesOnMesh") != getRegion()->bakesOnMeshEnabled())
if (gAgent.getRegion())
{
sMaxBakes = gAgent.getRegion()->bakesOnMeshEnabled() ? BAKED_NUM_INDICES : BAKED_LEFT_ARM;
if (!gSavedSettings.getBOOL("CurrentlyUsingBakesOnMesh") != getRegion()->bakesOnMeshEnabled())
{
// force a rebake when the last grid we were on (including previous login) had different BOM support
// This replicates forceAppearanceUpdate rather than pulling in the whole of llavatarself.
if(!LLGridManager::instance().isInSecondLife())
{
doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.0);
if (!LLGridManager::instance().isInSecondLife())
{
doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.f);
}
// update the setting even if we are in SL so that switch SL to OS and back
gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", getRegion()->bakesOnMeshEnabled());
}
// update the setting even if we are in SL so that switch SL to OS and back
gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", getRegion()->bakesOnMeshEnabled());
}
//</FS:Beq>
LLViewerObject::updateRegion(regionp);