Skip to content

Commit 0843014

Browse files
authored
FIX: Error thrown when Cancelling Control Scheme creation in Input actions Editor (ISXB-892) (#1939)
* fixed error thrown when Cancelling Control Scheme creation in Input Actions Editor
1 parent cbf4058 commit 0843014

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ however, it has to be formatted properly to pass verification tests.
1616
- Fixed resource designation for "d_InputControl" icon to address CI failure.
1717
- Fixed an issue where a composite binding would not be consecutively triggered after disabling actions while there are action modifiers in progress [ISXB-505](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-505).
1818
- Fixed prefabs and missing default control scheme used by PlayerInput component are now correctly shown in the inspector [ISXB-818](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-818)
19+
- Fixed error thrown when Cancelling Control Scheme creation in Input Actions Editor.
1920

2021
## [1.8.2] - 2024-04-29
2122

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/ControlSchemeCommands.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ public static Command ResetSelectedControlScheme()
135135
{
136136
return (in InputActionsEditorState state) =>
137137
{
138-
var controlSchemeSerializedProperty = state.serializedObject
139-
.FindProperty(nameof(InputActionAsset.m_ControlSchemes))
140-
.GetArrayElementAtIndex(state.selectedControlSchemeIndex);
138+
var controlSchemeSerializedProperty = state.selectedControlSchemeIndex == -1 ? null :
139+
state.serializedObject
140+
.FindProperty(nameof(InputActionAsset.m_ControlSchemes))
141+
.GetArrayElementAtIndex(state.selectedControlSchemeIndex);
141142

142143
if (controlSchemeSerializedProperty == null)
143144
{

0 commit comments

Comments
 (0)