diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 42f3d15a1c1536f3886f6823727836dedfb36733..b76dc6a96142487fcc6b82373aaeb8798585b207 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -1155,6 +1155,10 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe
         mSignalEnvChanged(env, env_version);
 }
 
+void LLEnvironment::setCurrentEnvironmentSelection(LLEnvironment::EnvSelection_t env)
+{
+    mCurrentEnvironment->setEnvironmentSelection(env);
+}
 
 void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironment::fixedEnvironment_t fixed, S32 env_version)
 {
@@ -1761,8 +1765,22 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader* shader)
 
 void LLEnvironment::updateSettingsUniforms()
 {
-    updateGLVariablesForSettings(mWaterUniforms, mCurrentEnvironment->getWater());
-    updateGLVariablesForSettings(mSkyUniforms, mCurrentEnvironment->getSky());
+    if (mCurrentEnvironment->getWater())
+    {
+        updateGLVariablesForSettings(mWaterUniforms, mCurrentEnvironment->getWater());
+    }
+    else
+    {
+        LL_WARNS("ENVIRONMENT") << "Failed to update GL variable for water settings, environment is not properly set" << LL_ENDL;
+    }
+    if (mCurrentEnvironment->getSky())
+    {
+        updateGLVariablesForSettings(mSkyUniforms, mCurrentEnvironment->getSky());
+    }
+    else
+    {
+        LL_WARNS("ENVIRONMENT") << "Failed to update GL variable for sky settings, environment is not properly set" << LL_ENDL;
+    }
 }
 
 void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition)
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 0ec06402f869c44015867f175a48f65eedbe8312..330de2bea87da56123b2164818e82dff3c237251 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -158,6 +158,8 @@ class LLEnvironment : public LLSimpleton<LLEnvironment>
 
     static void                 logEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version = NO_VERSION);
 
+    void                        setCurrentEnvironmentSelection(LLEnvironment::EnvSelection_t env);
+
 
     LLSettingsDay::ptr_t        getEnvironmentDay(EnvSelection_t env);
     LLSettingsDay::Seconds      getEnvironmentDayLength(EnvSelection_t env);
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 4f2c36f45b6217ae609cd8ef2b3dc5f190191add..fec218ca3b4b905cb575daea7998fffdceacf7b5 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -137,6 +137,7 @@ void LLFloaterFixedEnvironment::onClose(bool app_quitting)
     doCloseInventoryFloater(app_quitting);
 
     LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
+    LLEnvironment::instance().setCurrentEnvironmentSelection(LLEnvironment::ENV_LOCAL);
     LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
 
     mSettings.reset();