Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

FIX: ISXB-895 Fixed an issue where `InputActionAsset.FindAction` would unexpectedly throw `System.NullReferenceException`. #1937

Closed ekcoh closed 3 months ago

ekcoh commented 3 months ago

Description

Fixed an issue where InputActionAsset.FindAction(string, bool) would throw System.NullReferenceException instead of returning null if searching for a non-existent action with an explicit action path and using throwIfNotFound: false, e.g. searching for "Map/Action" when InputActionMap "Map" exists but no InputAction named "Action" exists within that map ISXB-895.

Changes made

Added a null check to actions array for path-evaluation in FindActions.

Checklist

Before review:

During merge: