fix #13624 DemoConsole app: An exception pops up when focusing on "Type Here" in contextMenuStrip under DarkMode
Fix #13624
Root cause
System.NulIReferenceException in line 566. This happens here because when in DarkMode we use ToolStripSystemDarkModeRenderer do the rendering work.
Proposed changes
- add null check like we did here
Before
https://github.com/user-attachments/assets/16e49163-1cc7-4748-a804-22ec36bf37a9
After
no Exception
Test methodology
- manual test
Microsoft Reviewers: Open in CodeFlow
Codecov Report
Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
Project coverage is 76.60341%. Comparing base (
08485db) to head (753da08). Report is 8 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #13635 +/- ##
===================================================
- Coverage 76.60828% 76.60341% -0.00487%
===================================================
Files 3253 3253
Lines 640996 640995 -1
Branches 47439 47439
===================================================
- Hits 491056 491024 -32
- Misses 146290 146321 +31
Partials 3650 3650
| Flag | Coverage Δ | |
|---|---|---|
| Debug | 76.60341% <0.00000%> (-0.00487%) |
:arrow_down: |
| integration | 18.98972% <0.00000%> (-0.00413%) |
:arrow_down: |
| production | 51.05805% <0.00000%> (-0.01096%) |
:arrow_down: |
| test | 97.41175% <ø> (ø) |
|
| unit | 48.43629% <0.00000%> (-0.01061%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Please add Root Cause in the description
Close this PR because Winform Designer does not support dark mode