From fc110b4362fb5af7b64c014fb6c746afb9c27bdb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 May 2020 17:28:27 +0300 Subject: SL-13327 Crash at LLViewerRegion::getWaterHeight --- indra/newview/llenvironment.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 7cf3cd5df1..e56ed92d9e 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1000,7 +1000,7 @@ bool LLEnvironment::canAgentUpdateRegionEnvironment() const if (gAgent.isGodlike()) return true; - return gAgent.getRegion()->canManageEstate(); + return gAgent.canManageEstate(); } bool LLEnvironment::isExtendedEnvironmentEnabled() const @@ -1056,7 +1056,8 @@ F32 LLEnvironment::getCamHeight() const F32 LLEnvironment::getWaterHeight() const { - return gAgent.getRegion()->getWaterHeight(); + LLViewerRegion* cur_region = gAgent.getRegion(); + return cur_region ? cur_region->getWaterHeight() : DEFAULT_WATER_HEIGHT; } bool LLEnvironment::getIsSunUp() const -- cgit v1.2.3