Skip to content

Commit d40a2ea

Browse files
authored
FIX: Check for valid index in current Control Scheme. (#2047)
1 parent daad73d commit d40a2ea

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ however, it has to be formatted properly to pass verification tests.
2424
- Fixed pasting bindings into empty Input Action asset. [ISXB-1180](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1180)
2525
- Fixed missing '&' symbol in Control Scheme dropdown on Windows platform. [ISXB-1109](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1109)
2626
- Fixed icon scaling in Input Actions window.
27+
- Fixed `ArgumentOutOfRangeException` when adding a new Control Scheme with any Device selected. [ISXB-1129](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1129)
2728

2829
### Changed
2930
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ private static bool ShouldBindingBeVisible(SerializedInputBinding serializedInpu
691691
if (currentControlScheme.HasValue && !string.IsNullOrEmpty(currentControlScheme.Value.name))
692692
{
693693
var isMatchingDevice = true;
694-
if (deviceIndex >= 0)
694+
if (deviceIndex >= 0 && deviceIndex < currentControlScheme.Value.deviceRequirements.Count)
695695
{
696696
var devicePathToMatch = InputControlPath.TryGetDeviceLayout(currentControlScheme.Value.deviceRequirements.ElementAt(deviceIndex).controlPath);
697697
var devicePath = InputControlPath.TryGetDeviceLayout(serializedInputBinding.path);

0 commit comments

Comments
 (0)