This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,11 +85,11 @@ void OnPreCull()
8585 // All the per-frame initialization logic has to be done in OnPreCull instead of Update
8686 // because [ImageEffectAllowedInSceneView] doesn't trigger Update events...
8787
88- if ( profile == null )
89- return ;
90-
9188 m_Camera = GetComponent < Camera > ( ) ;
9289
90+ if ( profile == null || m_Camera == null )
91+ return ;
92+
9393#if UNITY_EDITOR
9494 // Track the scene view camera to disable some effects we don't want to see in the
9595 // scene view
@@ -175,7 +175,7 @@ void OnPreRender()
175175
176176 void OnPostRender ( )
177177 {
178- if ( profile == null )
178+ if ( profile == null || m_Camera == null )
179179 return ;
180180
181181 // TAA messes with the projection matrix, so reset it before the classic post-processing
@@ -188,7 +188,7 @@ void OnPostRender()
188188 [ ImageEffectTransformsToLDR ]
189189 void OnRenderImage ( RenderTexture source , RenderTexture destination )
190190 {
191- if ( profile == null )
191+ if ( profile == null || m_Camera == null )
192192 {
193193 Graphics . Blit ( source , destination ) ;
194194 return ;
@@ -277,7 +277,7 @@ void OnGUI()
277277 if ( Event . current . type != EventType . Repaint )
278278 return ;
279279
280- if ( profile == null )
280+ if ( profile == null || m_Camera == null )
281281 return ;
282282
283283 if ( m_EyeAdaptation . active && profile . debugViews . IsModeActive ( DebugMode . EyeAdaptation ) )
You can’t perform that action at this time.
0 commit comments