diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-08-14 18:01:36 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-08-14 18:01:36 +0300 |
commit | cdf6548441df02132a8ee555b1f9efd695932ec3 (patch) | |
tree | b5914b2237e38a5009ae5fb22a3b5e49e5dff6d9 /indra/newview/llfloaterscriptlimits.cpp | |
parent | 9408490ac596a3ddee2cd0a2e1443e96cc6c0198 (diff) |
MAINT-7680 FIXED Viewer crashes after refreshing Script limit floater when region not set
Diffstat (limited to 'indra/newview/llfloaterscriptlimits.cpp')
-rw-r--r-- | indra/newview/llfloaterscriptlimits.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 5f0587a286..21df769d0c 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -112,24 +112,16 @@ BOOL LLFloaterScriptLimits::postBuild() } // contruct the panels - std::string land_url = gAgent.getRegion()->getCapability("LandResources"); - if (!land_url.empty()) - { - LLPanelScriptLimitsRegionMemory* panel_memory; - panel_memory = new LLPanelScriptLimitsRegionMemory; - mInfoPanels.push_back(panel_memory); - panel_memory->buildFromFile( "panel_script_limits_region_memory.xml"); - mTab->addTabPanel(panel_memory); - } - - std::string attachment_url = gAgent.getRegion()->getCapability("AttachmentResources"); - if (!attachment_url.empty()) - { - LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment; - mInfoPanels.push_back(panel_attachments); - panel_attachments->buildFromFile("panel_script_limits_my_avatar.xml"); - mTab->addTabPanel(panel_attachments); - } + LLPanelScriptLimitsRegionMemory* panel_memory = new LLPanelScriptLimitsRegionMemory; + mInfoPanels.push_back(panel_memory); + panel_memory->buildFromFile( "panel_script_limits_region_memory.xml"); + mTab->addTabPanel(panel_memory); + + LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment; + mInfoPanels.push_back(panel_attachments); + panel_attachments->buildFromFile("panel_script_limits_my_avatar.xml"); + mTab->addTabPanel(panel_attachments); + if(mInfoPanels.size() > 0) { @@ -195,6 +187,8 @@ LLPanelScriptLimitsRegionMemory::~LLPanelScriptLimitsRegionMemory() BOOL LLPanelScriptLimitsRegionMemory::getLandScriptResources() { + if (!gAgent.getRegion()) return FALSE; + LLSD body; std::string url = gAgent.getRegion()->getCapability("LandResources"); if (!url.empty()) @@ -718,10 +712,9 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() LLParcel* parcel = instance->getCurrentSelectedParcel(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); - LLUUID current_region_id = gAgent.getRegion()->getRegionID(); - if ((region) && (parcel)) { + LLUUID current_region_id = gAgent.getRegion()->getRegionID(); LLVector3 parcel_center = parcel->getCenterpoint(); region_id = region->getRegionID(); @@ -982,6 +975,8 @@ void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata) BOOL LLPanelScriptLimitsAttachment::requestAttachmentDetails() { + if (!gAgent.getRegion()) return FALSE; + LLSD body; std::string url = gAgent.getRegion()->getCapability("AttachmentResources"); if (!url.empty()) |