File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1464,8 +1464,8 @@ public bool ShouldIgnoreHotkeys()
14641464
14651465 public void Show ( )
14661466 {
1467- // Invoke on UI thread
1468- Application . Current . Dispatcher . Invoke ( ( ) =>
1467+ // When application is exitting, the Application.Current will be null
1468+ Application . Current ? . Dispatcher . Invoke ( ( ) =>
14691469 {
14701470 // When application is exitting, the Application.Current will be null
14711471 if ( Application . Current ? . MainWindow is MainWindow mainWindow )
@@ -1539,8 +1539,8 @@ public async void Hide()
15391539 break ;
15401540 }
15411541
1542- // Invoke on UI thread
1543- Application . Current . Dispatcher . Invoke ( ( ) =>
1542+ // When application is exitting, the Application.Current will be null
1543+ Application . Current ? . Dispatcher . Invoke ( ( ) =>
15441544 {
15451545 // When application is exitting, the Application.Current will be null
15461546 if ( Application . Current ? . MainWindow is MainWindow mainWindow )
You can’t perform that action at this time.
0 commit comments