Errors throwns when Delta [Mouse] has a Scale Vector 2 processor in OnDisable of PlayerInput.

Hello,

I’m using Unity 2022.1.12f1 with the Input System 1.4.2 package. I could only reproduce it with the mouse delta, but I have not tested every vector 2.

My action is setup as follows:
Action Map: “Player”
Action: “Rotation”, Value: Vector2
Binding: “Right Stick [Gamepad]”, Control scheme: Controller
Binding: “Delta [Mouse]”, Control scheme: Mouse&Keyboard, Processor: Scale Vector 2 (0.1, 0.1)

3 errors get thrown in the OnDisable function of the PlayerInput class:

NullReferenceException while resolving binding ‘Rotation:/delta[Mouse&Keyboard]’ in action map ‘InputActions (UnityEngine.InputSystem.InputActionAsset):player’
UnityEngine.InputSystem.PlayerInput:OnDisable () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1734)

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.InputBindingResolver.InstantiateWithParameters[TType] (UnityEngine.InputSystem.Utilities.TypeTable registrations, System.String namesAndParameters, TType[ ]& array, System.Int32& count, UnityEngine.InputSystem.InputActionMap actionMap, UnityEngine.InputSystem.InputBinding& binding) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputBindingResolver.cs:638)
UnityEngine.InputSystem.InputBindingResolver.AddActionMap (UnityEngine.InputSystem.InputActionMap actionMap) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputBindingResolver.cs:304)
UnityEngine.InputSystem.PlayerInput:OnDisable() (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1734)

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.InputBindingResolver.InstantiateWithParameters[TType] (UnityEngine.InputSystem.Utilities.TypeTable registrations, System.String namesAndParameters, TType[ ]& array, System.Int32& count, UnityEngine.InputSystem.InputActionMap actionMap, UnityEngine.InputSystem.InputBinding& binding) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputBindingResolver.cs:638)
UnityEngine.InputSystem.InputBindingResolver.AddActionMap (UnityEngine.InputSystem.InputActionMap actionMap) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputBindingResolver.cs:592)
UnityEngine.InputSystem.InputActionMap.ResolveBindings () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionMap.cs:1352)
UnityEngine.InputSystem.InputActionMap.ResolveBindingsIfNecessary () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionMap.cs:1217)
UnityEngine.InputSystem.InputActionState.DeferredResolutionOfBindings () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionState.cs:4449)
UnityEngine.InputSystem.InputActionRebindingExtensions+DeferBindingResolutionWrapper.Dispose () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionRebindingExtensions.cs:2807)
UnityEngine.InputSystem.PlayerInput.OnDisable () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1734)

The inspector also throws 3 errors after the above errors are thrown:
ArgumentNullException: Value cannot be null.
Parameter name: source
System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable1[T] source, TSource value, System.Collections.Generic.IEqualityComparer1[T] comparer) (at :0)
System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value) (at :0)
UnityEngine.InputSystem.InputActionState.FetchActionState (UnityEngine.InputSystem.InputAction action) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionState.cs:887)
UnityEngine.InputSystem.InputAction.get_currentState () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:1492)
UnityEngine.InputSystem.InputAction.get_phase () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:508)
UnityEngine.InputSystem.InputAction.get_enabled () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:533)
UnityEngine.InputSystem.InputActionAsset.FindAction (System.String actionNameOrId, System.Boolean throwIfNotFound) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionAsset.cs:549)
UnityEngine.InputSystem.Editor.PlayerInputEditor.OnActionAssetChange () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs:443)
UnityEngine.InputSystem.Editor.PlayerInputEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs:77)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass62_0.b__0 () (at :0)
UnityEditor.InspectorWindow:RedrawFromNative()

ArgumentNullException: Value cannot be null.
Parameter name: source
System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable1[T] source, TSource value, System.Collections.Generic.IEqualityComparer1[T] comparer) (at :0)
System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value) (at :0)
UnityEngine.InputSystem.InputActionState.FetchActionState (UnityEngine.InputSystem.InputAction action) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionState.cs:887)
UnityEngine.InputSystem.InputAction.get_currentState () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:1492)
UnityEngine.InputSystem.InputAction.get_phase () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:508)
UnityEngine.InputSystem.InputAction.get_enabled () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputAction.cs:533)
UnityEngine.InputSystem.InputActionAsset.FindAction (System.String actionNameOrId, System.Boolean throwIfNotFound) (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Actions/InputActionAsset.cs:549)
UnityEngine.InputSystem.Editor.PlayerInputEditor.OnActionAssetChange () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs:443)
UnityEngine.InputSystem.Editor.PlayerInputEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs:77)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass62_0.b__0 () (at :0)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

ArgumentException: Getting control 1’s position in a group with only 1 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at :0)
UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEngine.GUILayoutUtility.GetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEditor.EditorGUILayout.GetControlRect (System.Boolean hasLabel, System.Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEditor.EditorGUILayout.GetControlRect (System.Boolean hasLabel, System.Single height, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, UnityEngine.GUILayoutOption[ ] options) (at :0)
UnityEngine.InputSystem.Editor.PlayerInputEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs:138)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass62_0.b__0 () (at :0)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

I did some additional testing and the issue only appears after you set the enabled flag to true on the PlayerInput to true. Regardless of whether or not the component is already enabled or not.