From 36028f687919969e86e90ee21ae4fd109a2d4284 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Mon, 27 Apr 2020 13:44:23 +0200 Subject: [PATCH 1/2] Fixed a null ref exception in static sky when the default volume profile is invalid. --- .../Runtime/Sky/StaticLightingSky.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs index d2cb6061cc2..16729facca7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -132,7 +132,9 @@ void UpdateCurrentStaticLightingSky() var profileSkyParameters = m_SkySettingsFromProfile.parameters; var defaultVolume = HDRenderPipeline.GetOrCreateDefaultVolume(); - defaultVolume.sharedProfile.TryGet(skyType, out SkySettings defaultSky); + SkySettings defaultSky = null; + if (defaultVolume.sharedProfile != null) // This can happen with old projects. + defaultVolume.sharedProfile.TryGet(skyType, out defaultSky); var defaultSkyParameters = defaultSky != null ? defaultSky.parameters : null; // Can be null if the profile does not contain the component. // Seems to inexplicably happen sometimes on domain reload. From 8474041439199cb7df93481d6a2677f673078eba Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Mon, 27 Apr 2020 13:44:41 +0200 Subject: [PATCH 2/2] Update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9a44d272973..0b9ea2c1008 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -564,6 +564,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue when toggling anything in HDRP asset that will produce an error (case 1238155) - Fixed shader warning in PCSS code when using Vulkan. - Fixed decal that aren't working without Metal and Ambient Occlusion option enabled. +- Fixed a null ref exception in static sky when the default volume profile is invalid. ### Changed - Improve MIP selection for decals on Transparents