From 126191ada56cf5daa694493a9ad5188beda11253 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 7 Aug 2018 22:47:55 +0100 Subject: Protect sky code from (extremely unlikely yet still possible) lack of sky settings. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvosky.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d30657a30a..7e7b7fda84 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8664,7 +8664,7 @@ Type Boolean Value - 0 + 1 RenderLocalLights diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 899da3e420..64be033fdc 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1418,8 +1418,11 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, void LLVOSky::updateFog(const F32 distance) { LLEnvironment& environment = LLEnvironment::instance(); - LLVector3 light_dir = LLVector3(environment.getClampedLightNorm()); - m_legacyAtmospherics.updateFog(distance, light_dir); + if (environment.getCurrentSky() != nullptr) + { + LLVector3 light_dir = LLVector3(environment.getClampedLightNorm()); + m_legacyAtmospherics.updateFog(distance, light_dir); + } } void LLVOSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_dir_cfr, const LLVector3 &moon_dir_cfr) -- cgit v1.2.3