[release/10.0] Fix Control.Dispose crash when dependent UserControl fails to load due to missing assembly#14398
Open
github-actions[bot] wants to merge 1 commit intorelease/10.0from
Open
Conversation
…e to missing assembly
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/10.0 #14398 +/- ##
======================================================
+ Coverage 77.10644% 77.11109% +0.00464%
======================================================
Files 3273 3273
Lines 645033 645033
Branches 47701 47702 +1
======================================================
+ Hits 497362 497392 +30
+ Misses 143989 143964 -25
+ Partials 3682 3677 -5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #13840 to release/10.0
Fixes #14393
Customer Impact
This change ensures that
Control.Dispose()can safely execute even when the control was never fully constructed.Fix
Added a defensive null check around
ContextMenuStripaccess inControl.Dispose()Replaced direct property access with
Properties?.TryGetValue(...)to ensure safe event unsubscriptionTesting
Manual with the customer repro case.
Risk
Low - This fix only adds a defensive null check and will not affect existing logic.