Skip to content

Check if the shortcut sequence is set before using it - #12595

Merged
saintmatthieu merged 1 commit into
audacity:masterfrom
kryksyh:fix-12368-empty-split-tool-shortcut
Oct 28, 2026
Merged

saintmatthieu merged 1 commit into
audacity:masterfrom
kryksyh:fix-12368-empty-split-tool-shortcut

Conversation

@kryksyh

@kryksyh kryksyh commented Oct 26, 2026

Copy link
Copy Markdown
Member

Resolves: #12368

  • I signed CLA
  • This PR includes AI assistance
  • If the PR is AI-assisted, I have read, understood and complied with the guidelines for AI-assisted contributions
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b3c0528-4bf0-454a-a25a-7b25ad55a9d1
Commits

Reviewing files that changed from the base of the PR and between 7c4aff1 and 94d114c.

Files selected for processing: 1
  • src/projectscene/internal/tapholdshortcut.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

TapHoldShortcut::matchKeyEvent now returns false when a shortcut has no sequences. It also checks shortcut validity before checking whether the shortcut context is allowed.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 94d11

The reported empty-shortcut crash path is guarded, with no remaining merge-blocking risk identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: checking that a shortcut sequence exists before it is used.
Description check Passed The description identifies the resolved issue and completes the repository checklist. It does not include the requested short description of the changes or the motivation for the fix.
Linked Issues check Passed Issue #12368 requires the application to avoid a crash when a single-button shortcut is used after the Split tool shortcut is cleared. In TapHoldShortcut::matchKeyEvent, the PR now returns false w…
Out of Scope Changes check Passed The PR changes only src/projectscene/internal/tapholdshortcut.cpp. The change guards empty shortcut sequences in the shortcut event-matching path. This directly supports issue #12368 and introduces …
Full details: Linked Issues check

Explanation

Issue #12368 requires the application to avoid a crash when a single-button shortcut is used after the Split tool shortcut is cleared. In TapHoldShortcut::matchKeyEvent, the PR now returns false when m_shortcut.sequences is empty before it accesses front(). This prevents the cleared-shortcut access that caused the crash. The change also preserves the existing validity and context checks.

Full details: Out of Scope Changes check

Explanation

The PR changes only src/projectscene/internal/tapholdshortcut.cpp. The change guards empty shortcut sequences in the shortcut event-matching path. This directly supports issue #12368 and introduces no unrelated behavior or files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@saintmatthieu
saintmatthieu force-pushed the fix-12368-empty-split-tool-shortcut branch from 94d114c to 504530c Compare October 28, 2026 11:11
@saintmatthieu
saintmatthieu merged commit 6b7f32a into audacity:master Oct 28, 2026
4 of 10 checks passed
saintmatthieu added a commit that referenced this pull request Oct 28, 2026
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.

Crash when pressing a shortcut if "split tool" shortcut is cleared

3 participants