Search Issue Tracker

Fixed in 2019.3.X

Votes

0

Found in

2019.2.0a11

2019.3.0a1

Issue ID

1171833

Regression

Yes

[Scripting] Argument exception is thrown on right-clicking a gameObject with missing script instance

Scripting

-

"ArgumentException: Object at index 0 is null" exception is thrown on right-clicking a gameObject with missing script instance. Refer to the attached video.

Steps to reproduce:
1) Create a new project.
2) Main Camera > Add component > New script > Create and add.
3) Delete the script from the project.
4) Select Main Camera > Right-click on the missing script instance

Actual result: Argument exception is thrown in console.
Expected result: No exception is thrown in console.

Occurring in: 2019.3.0a11, 2019.2.0f1, 2019.2.0a11
Working fine in: 2019.2.0a10

Environment: Both Windows and Mac.

Stack trace:

ArgumentException: Object at index 0 is null
UnityEditor.SerializedObject.GetType () (at C:/buildslave/unity/build/Editor/Mono/SerializedObject.bindings.cs:34)
UnityEditor.EditorGUI.FillPropertyContextMenu (UnityEditor.SerializedProperty property, UnityEditor.SerializedProperty linkedProperty, UnityEditor.GenericMenu menu) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:2367)
UnityEditor.EditorGUI.DoPropertyContextMenu (UnityEditor.SerializedProperty property, UnityEditor.SerializedProperty linkedProperty, UnityEditor.GenericMenu menu) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:2468)
UnityEditor.EditorGUI.EndProperty () (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5654)
UnityEditor.EditorGUI.DefaultPropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6334)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:149)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:106)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:208)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9355)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9339)
UnityEditor.GenericInspector.MissingMonoBehaviourGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:137)
UnityEditor.GenericInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:197)
UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:479)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

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.