File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/System.Windows.Forms/System/Windows/Forms Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4790,7 +4790,7 @@ protected override void Dispose(bool disposing)
4790
4790
}
4791
4791
4792
4792
// Unsubscribes from the Disposed event of the ContextMenuStrip.
4793
- if ( ContextMenuStrip is ContextMenuStrip menu )
4793
+ if ( Properties ? . TryGetValue ( s_contextMenuStripProperty , out ContextMenuStrip ? menu ) == true )
4794
4794
{
4795
4795
menu . Disposed -= DetachContextMenuStrip ;
4796
4796
}
@@ -4816,10 +4816,10 @@ protected override void Dispose(bool disposing)
4816
4816
SuspendLayout ( ) ;
4817
4817
try
4818
4818
{
4819
- Properties . RemoveValue ( s_ncAccessibilityProperty ) ;
4819
+ Properties ? . RemoveValue ( s_ncAccessibilityProperty ) ;
4820
4820
4821
4821
DisposeAxControls ( ) ;
4822
- Properties . GetValueOrDefault < ActiveXImpl > ( s_activeXImplProperty ) ? . Dispose ( ) ;
4822
+ Properties ? . GetValueOrDefault < ActiveXImpl > ( s_activeXImplProperty ) ? . Dispose ( ) ;
4823
4823
4824
4824
ResetBindings ( ) ;
4825
4825
You can’t perform that action at this time.
0 commit comments