Unity Issue Tracker - InputActionAsset.FindAction throws exception if map is empty. (EditMode)
Fixed
ISXB-895
InputActionAsset.FindAction throws exception if map is empty. (EditMode)
Package: Input System
Fixed
1.8.X
Fixed in upcoming Input System version 1.8.3
Steps to reproduce:
var asset = ScriptableObject.Create<InputActionAsset>(); asset.AddActionMap("Map"); asset.FindAction("Map/NonExistent"); // <--- NullReferenceException here
Actual results:
Exception thrown of type NullReferenceException.
Expected results:
null returned from FindAction
Reproducible with versions:
Input System 1.8.2
Not reproducible with versions:
Doesn't seem to be a regression
Can’t test with versions:
N/A
Tested on (OS):
macOS
Notes:
FindAction should have same semantics regardless of used search string.
Either null checking is needed in this function or InputActionMap without actions should be created with an array of size 0.
Prioritise and Follow this issue
Have a workaround or additional info about this issue?