Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
9.0.0, 8.1.0, 8.0.1
Issue ID
1243955
Regression
No
[HDRP] ArgumentNullException errors are thrown on removing Light component from Direction Light preset asset
-ArgumentNullException and SerializedObject target has been destroyed
errors are thrown on removing Light component from Direction Light preset asset.
-ApplySingleProperty copy state error: SerializedProperty could not be found for customPasses.Array.data[0].m_Name is thrown in the console.
Steps to repro:
1. Create a new HDRP Project.
2. Hierarchy > Direction Light > Create its preset asset.
3. Project Window > Select Light preset asset.
4. Remove Direction Light Component.
Actual Result:
- ArgumentNullException and SerializedObject target has been destroyed
errors are thrown in the console.
- MissingReferenceException error in the console.
-NullReferenceException error in the console.
Expected Result:
- No errors in the console.
Reproducible in:
2020.2.0a10, 2020.1.0b8, 2019.3.0f3 with Package Version: 9.0.0, 8.1.0, 8.0.1, 7.1.8.
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 <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
MissingReferenceException: The object of type 'Light' 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.EditorUtility.DisplayObjectContextMenu (UnityEngine.Rect position, UnityEngine.Object[] context, System.Int32 contextUserData) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.EditorGUI.DoInspectorTitlebar (UnityEngine.Rect position, System.Int32 id, System.Boolean foldout, UnityEngine.Object[] targetObjs, UnityEditor.SerializedProperty enabledProperty, UnityEngine.GUIStyle baseStyle) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.EditorGUI.InspectorTitlebar (UnityEngine.Rect position, System.Boolean foldout, UnityEditor.Editor editor) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.EditorGUILayout.InspectorTitlebar (System.Boolean foldout, UnityEditor.Editor editor) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.DrawInternalInspector () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <599a88f0dc984e9a84071cb802b80734>: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 <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.OnHeaderControlsGUI () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.DrawHeaderGUI (UnityEditor.Editor editor, System.String header, System.Single leftMargin) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.DrawHeaderGUI (UnityEditor.Editor editor, System.String header) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.OnHeaderGUI () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.DrawHeaderFromInsideHierarchy () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Editor.DrawHeader () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.DrawInternalInspector () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
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
- Memory leak when a lot of UI elements are spawned and despawned
- Warnings are not logged in the Console window when using external code analyzers
- Errors “TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 288“ appear constantly when Prefab is open
- Crash on PPtr<Shader>::operator or NullException errors spammed in console when calling Dispose() on null GraphicsBuffer with baked Reflection Probes
- “EndRenderPass: Not inside a Renderpass” and other Render Graph errors in the Player when Render Graph is enabled and Overlay UI is used
Resolution Note:
This is a known issue and there is an ongoing effort for 2021 to solve it. This also applies to Camera and Light component. Closing as won't fix.