Skip to content

Commit 673c15d

Browse files
committed
Check deviceIndex is valid in currentControlScheme
1 parent b0478f0 commit 673c15d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)