From a8714e1c0b3eaaf5150d7fc7786996eedfd871af 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 d3aa6bb1293..14822937688 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -125,7 +125,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 0ccf21f8d2b95b6ed07430a79666b78801909fcd Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 28 Apr 2020 16:35:20 +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 fd32fbcb022..e5d749fb8ed 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed shadowmask UI now correctly showing shadowmask disable +- Fixed a null ref exception in static sky when the default volume profile is invalid. ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings