Search Issue Tracker

Fixed

Votes

0

Found in

2021.3.33f1

Issue ID

UUM-58458

Regression

Yes

"Object reference not set to an instance of an object" is thrown when destroying a GameObject with a Camera Component

--

-

How to reproduce:
1. Open the “VolumeStackException“ project
2. Open the “Scene/Bootstrap“ scene
3. Enter Play Mode
4. In the Game view window select “Load Scene”
5. Observe the Game view and the Console

Expected result: The “SampleScene” is loaded
Actual result: The “SampleScene” is not loaded and “Object reference not set to an instance of an object" errors are thrown

Reproduced with: 2021.3.23f1, 2021.3.33f1
Not reproduced with: 2021.2.0a21, 2021.3.22f1, 2022.3.15f1, 2023.2.4f1, 2023.3.0a18
Fixed in: 2022.1.0a1

Reproduced on: Windows 10 (by reporter), Windows 11
Not reproduced on: No other environment tested

Notes:
1. On non-reproducible versions the scene loads but other errors are thrown → see internal comments for errors
2. Not reproducible in HD RP
3. Reproducible in a new project

Full errors throw to the Console:

{noformat}NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.VolumeComponent.Override (UnityEngine.Rendering.VolumeComponent state, System.Single interpFactor) (at Library/PackageCache/com.unity.render-pipelines.core@12.1.13/Runtime/Volume/VolumeComponent.cs:235)
UnityEngine.Rendering.VolumeManager.OverrideData (UnityEngine.Rendering.VolumeStack stack, System.Collections.Generic.List`1[T] components, System.Single interpFactor) (at Library/PackageCache/com.unity.render-pipelines.core@12.1.13/Runtime/Volume/VolumeManager.cs:241)
UnityEngine.Rendering.VolumeManager.Update (UnityEngine.Rendering.VolumeStack stack, UnityEngine.Transform trigger, UnityEngine.LayerMask layerMask) (at Library/PackageCache/com.unity.render-pipelines.core@12.1.13/Runtime/Volume/VolumeManager.cs:385)
UnityEngine.Rendering.Universal.CameraExtensions.UpdateVolumeStack (UnityEngine.Camera camera, UnityEngine.Rendering.Universal.UniversalAdditionalCameraData cameraData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalAdditionalCameraData.cs:156)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.UpdateVolumeFramework (UnityEngine.Camera camera, UnityEngine.Rendering.Universal.UniversalAdditionalCameraData additionalCameraData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:685)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:558)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:280)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <53aac14d88ba4477acc998b039cfd73a>:0)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <53aac14d88ba4477acc998b039cfd73a>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&){noformat}

{noformat}NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.Universal.UniversalRenderPipeline.CheckPostProcessForDepth (UnityEngine.Rendering.Universal.CameraData& cameraData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:717)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.InitializeAdditionalCameraData (UnityEngine.Camera camera, UnityEngine.Rendering.Universal.UniversalAdditionalCameraData additionalCameraData, System.Boolean resolveFinalTarget, UnityEngine.Rendering.Universal.CameraData& cameraData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:951)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.InitializeCameraData (UnityEngine.Camera camera, UnityEngine.Rendering.Universal.UniversalAdditionalCameraData additionalCameraData, System.Boolean resolveFinalTarget, UnityEngine.Rendering.Universal.CameraData& cameraData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:753)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:559)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.13/Runtime/UniversalRenderPipeline.cs:280)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <53aac14d88ba4477acc998b039cfd73a>:0)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <53aac14d88ba4477acc998b039cfd73a>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&){noformat}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.