Skip to content

Commit 7e7d40e

Browse files
authored
FIX: index out of bounds after undo duplicating action maps (ISX-1661) (#1780)
* fixed index out of bounds after undo duplicating action maps * added changelog
1 parent 504ecd1 commit 7e7d40e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ however, it has to be formatted properly to pass verification tests.
3434
- Fixed an issue where undoing deletion of Action Maps did not restore Actions correctly.
3535
- Fixed case [ISXB-628](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-628) (OnIMECompositionChange does not return an empty string on accept when using Microsoft IME) by clarifying expectations and intended usage for the IME composition change event.
3636
- Fixed case [ISX-1668] (The Profiler shows incorrect data and spams the console with "Missing Profiler.EndSample" errors when there is an Input System Component in Scene).
37+
- Fixed [ISX-1661](https://jira.unity3d.com/browse/ISX-1661) where undoing duplications of action maps caused console errors
3738
- Fix for BindingSyntax `WithInteraction()` which was incorrectly using processors.
3839

40+
3941
## [1.8.0-pre.1] - 2023-09-04
4042

4143
### Added

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,17 @@ internal static partial class Selectors
308308
public static List<TreeViewItemData<ActionOrBindingData>> GetActionsAsTreeViewData(InputActionsEditorState state)
309309
{
310310
var actionMapIndex = state.selectedActionMapIndex;
311-
var actionMaps = state.serializedObject.FindProperty(nameof(InputActionAsset.m_ActionMaps));
312-
313311
var controlSchemes = state.serializedObject.FindProperty(nameof(InputActionAsset.m_ControlSchemes));
314-
var actionMap = actionMapIndex == -1 || actionMaps.arraySize <= 0 ?
315-
null : actionMaps.GetArrayElementAtIndex(actionMapIndex);
312+
var actionMap = GetSelectedActionMap(state);
316313

317314
if (actionMap == null)
318315
return new List<TreeViewItemData<ActionOrBindingData>>();
319316

320-
var actions = actionMap
317+
var actions = actionMap.Value.wrappedProperty
321318
.FindPropertyRelative(nameof(InputActionMap.m_Actions))
322319
.Select(sp => new SerializedInputAction(sp));
323320

324-
var bindings = actionMap
321+
var bindings = actionMap.Value.wrappedProperty
325322
.FindPropertyRelative(nameof(InputActionMap.m_Bindings))
326323
.Select(sp => new SerializedInputBinding(sp))
327324
.ToList();

0 commit comments

Comments
 (0)