Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
9.0.0, 8.1.0, 8.0.1
Issue ID
1242029
Regression
No
[HDRP] ArgumentNullException and NullReferenceException errors are thrown on removing Camera Component from its preset asset
-ArgumentNullException and NullReferenceException errors are thrown on removing Camera Component from its preset asset.
-MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
Steps to repro:
1. Create a new HDRP project.
2. Select the Main Camera > Create its preset.
3. Select Camera preset > Inspector > Remove Camera component.
Actual Result:
ArgumentNullException and NullReferenceException errors are thrown in the console.
Expected Result:
No error in the console.
Reproducible in:
2020.2.0a9, 2020.1.0b8, 2020.1.0a23 with Package Version 9.0.0, 8.1.0, 8.0.1.
Note: In package Version 7.3.1 there is no provision to remove Camera component from its preset asset.
Environment:
Occurring on Windows 10 & Mac 10.15.
stack trace:
SerializedObject target has been destroyed.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
ArgumentNullException: Value cannot be null.
Parameter name: source
UnityEditor.Presets.PresetEditor.DrawInternalInspector () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AssetDatabase.IsMainAsset (UnityEngine.Object obj) (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.OnHeaderControlsGUI () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.DrawHeaderGUI (UnityEditor.Editor editor, System.String header, System.Single leftMargin) (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.DrawHeaderGUI (UnityEditor.Editor editor, System.String header) (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.OnHeaderGUI () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.DrawHeaderFromInsideHierarchy () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Editor.DrawHeader () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.DrawInternalInspector () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.Presets.PresetEditor.DestroyInternalEditor () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
UnityEditor.Presets.PresetEditor.OnDisable () (at <5951c2421c324f47883bd5ba8a4bf507>:0)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on `anonymous namespace'::PrepareTreesAndWriteWindParamsJobData::Execute when entering Play Mode on a specific project
- Errors "InvalidOperationException: Trying to use a texture (_InternalGradingLut)..." and “Render Graph Execution error” shown and Scene turns black when 16 or more Render Objects are used
- GameObjects in the Game View are rendered differently than in the Scene View when the Rendering Path is set to "Deferred" and Screen Space Shadows Renderer Feature is added
- Errors “InvalidOperationException: Trying to use a texture (_CameraDepthTexture)...” and “Render Graph Execution error” shown when selecting GameObjects with Mesh Renderer from the Hierarchy
- macOS stutters in a minimal project
Resolution Note:
This is a known issue and there is an ongoing effort for 2021 to solve it. This also applies to Light component. Closing as won't fix. We hope to solve this in 2021