Skip to content

Fix: Prevent crash when parsing an empty hotkey string #17369

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

seer-by-sentry[bot]
Copy link
Contributor

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. The issue was that: HotKey.Parse receives empty string, leading to parts list becoming empty, then parts[^1] access throws IndexOutOfRangeException.
  2. Fixes an issue where parsing an empty hotkey string would cause an error.
  3. Returns HotKey.None when the input string is null or empty.

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

Fyi @0x5bfa

@yaira2 yaira2 marked this pull request as ready for review July 30, 2025 14:37
@yaira2 yaira2 changed the title Fix: Return HotKey.None when parsing an empty hotkey string Fix: Prevent crash when parsing an empty hotkey string Jul 30, 2025
@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Jul 30, 2025
Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

LGTM.

@yaira2 yaira2 merged commit 30ae1a3 into main Jul 30, 2025
9 checks passed
@yaira2 yaira2 deleted the seer/fix/empty-hotkey-string branch July 30, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants