File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,12 @@ public static int GetSelectedBindingIndexAfterCompositeBindings(InputActionsEdit
114114
115115 public static int GetBindingIndexBeforeAction ( SerializedProperty arrayProperty , int indexToInsert , SerializedProperty bindingArrayToInsertTo )
116116 {
117- Debug . Assert ( indexToInsert >= 0 && indexToInsert <= arrayProperty . arraySize , "Invalid action index to insert bindings before." ) ;
117+ // Need to guard against this case, as there is different behaviour when pasting actions vs actionmaps
118+ if ( indexToInsert < 0 )
119+ {
120+ return - 1 ;
121+ }
122+ Debug . Assert ( indexToInsert <= arrayProperty . arraySize , "Invalid action index to insert bindings before." ) ;
118123 var offset = 1 ; //previous action offset
119124 while ( indexToInsert - offset >= 0 )
120125 {
You can’t perform that action at this time.
0 commit comments