Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
May 29, 2024

Conversation

ekcoh
Copy link
Collaborator

@ekcoh ekcoh commented May 27, 2024

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:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • Tests added/changed, if applicable.
    • Functional tests: Actions_CanAttemptToLookUpNonExistentActionInAssetByPath.
    • Performance tests: Not expecting any noticeable differences.
    • Integration tests: N/A
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@ekcoh ekcoh requested review from Pauliusd01 and graham-huws May 27, 2024 07:18
@ekcoh ekcoh changed the title FIX: Fixed an issue where InputActionAsset.FindAction would unexpectedly throw System.NullReferenceException (ISXB-895). FIX: ISXB-895 Fixed an issue where InputActionAsset.FindAction would unexpectedly throw System.NullReferenceException. May 27, 2024
@ekcoh ekcoh requested a review from ritamerkl May 27, 2024 10:38
Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, checked FindAction functionality with existing and non extisting actions

@ekcoh ekcoh merged commit 5ecee3e into develop May 29, 2024
77 of 79 checks passed
@ekcoh ekcoh deleted the isxb-895-find-operation-in-editor-mode-fix branch May 29, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants