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

[release/9.0] Fix #12661 Null Reference Exception: System.Windows.Forms.TabControl.<WmSelChange> #12728

Merged
merged 5 commits into from
Jan 8, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 8, 2025

Backport of #12683 to release/9.0
Fixes #12661

/cc @LeafShi1 @John-Qiao

Customer Impact

A customer reported a crash in their application that uses WinForms TabControl and requested a fix in NET8 release. Application is running under accessibility tools and is removing TabPages from a control dynamically. When the selected page is removed, the selection moves to the next page and the corresponding accessibility event is queued using BeginInvoke to be raised. If by the time the event is raised, the page is removed, a NullReferenceException is thrown. No workaround is available.

Fix

Test if the selected page is still available before raising the accessibility event inside the BeginInvoke delegate.

Testing

Manual with the customer repro case and unit tests.

Risk

Low - this is an additional validation only.

Microsoft Reviewers: Open in CodeFlow

@github-actions github-actions bot requested a review from a team as a code owner January 8, 2025 05:38
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.00847%. Comparing base (2506929) to head (0335521).
Report is 4 commits behind head on release/9.0.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           release/9.0      #12728          +/-   ##
======================================================
+ Coverage     74.82960%   97.00847%   +22.17887%     
======================================================
  Files             3022        1066        -1956     
  Lines           630276      345877      -284399     
  Branches         46797        5040       -41757     
======================================================
- Hits            471633      335530      -136103     
+ Misses          155260        9625      -145635     
+ Partials          3383         722        -2661     
Flag Coverage Δ
Debug 97.00847% <100.00000%> (+22.17887%) ⬆️
integration ?
production ?
test 97.00847% <100.00000%> (+0.00016%) ⬆️
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

@Tanya-Solyanik Tanya-Solyanik added Servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) labels Jan 8, 2025
@Tanya-Solyanik Tanya-Solyanik added Servicing-approved .NET Shiproom approved the PR for merge and removed 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) Servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Jan 8, 2025
@Tanya-Solyanik Tanya-Solyanik merged commit 87c7908 into release/9.0 Jan 8, 2025
8 checks passed
@Tanya-Solyanik Tanya-Solyanik deleted the backport/pr-12683-to-release/9.0 branch January 8, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Servicing-approved .NET Shiproom approved the PR for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants