File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
com.unity.render-pipelines.core Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
14
14
- Fixed copy/pasting of Volume Components when loading a new scene
15
15
- Fix LookDev's camera button layout.
16
16
- Fix LookDev's layout vanishing on domain reload.
17
+ - Fixed null reference exception in LookDev when setting the SRP to one not implementing LookDev (case 1245086)
17
18
18
19
## [ 7.3.0] - 2020-03-11
19
20
Original file line number Diff line number Diff line change 3
3
using UnityEngine ;
4
4
using UnityEngine . UIElements ;
5
5
6
+ using RenderPipelineManager = UnityEngine . Rendering . RenderPipelineManager ;
7
+
6
8
namespace UnityEditor . Rendering . LookDev
7
9
{
8
10
/// <summary>Interface that must implement the viewer to communicate with the compositor and data management</summary>
@@ -680,6 +682,17 @@ void OnGUI()
680
682
rootVisualElement . styleSheets . Add ( styleSheetLight ) ;
681
683
}
682
684
685
+ // [case 1245086] Guard in case the SRP asset is set to null (or to a not supported SRP) when the lookdev window is already open
686
+ // Note: After an editor reload, we might get a null OnUpdateRequestedInternal and null SRP for a couple of frames, hence the check.
687
+ if ( ! LookDev . supported && OnUpdateRequestedInternal != null )
688
+ {
689
+ // Print an error and close the Lookdev window (to avoid spamming the console)
690
+ Debug . LogError ( $ "LookDev is not supported by this Scriptable Render Pipeline: "
691
+ + ( RenderPipelineManager . currentPipeline == null ? "No SRP in use" : RenderPipelineManager . currentPipeline . ToString ( ) ) ) ;
692
+ LookDev . Close ( ) ;
693
+ return ;
694
+ }
695
+
683
696
OnUpdateRequestedInternal ? . Invoke ( ) ;
684
697
}
685
698
}
You can’t perform that action at this time.
0 commit comments