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
- Inspector's custom tooltip is displayed incorrectly when the name is truncated in UI toolkit
- Crash on ScriptableRenderLoopDraw when rendering a specific VFX in Play Mode
- The script is not renamed in the Project window when renaming and a compilation Error is present
- Average FPS in Play Mode degradation on a newly created BiRP project when it's upgraded from 2020.3.48f1 to a newer Editor version
- DecoratorDrawer indentation is incorrect when it is called with EditorGUI
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.