Skip to content

Commit bc823b3

Browse files
committed
Fix Application.Current null exception
1 parent db46a4a commit bc823b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ public static unsafe void SwitchToEnglishKeyboardLayout(bool backupPrevious)
364364
// No installed English layout found
365365
if (enHKL == HKL.Null) return;
366366

367+
// When application is exiting, the Application.Current will be null
368+
if (Application.Current == null) return;
369+
367370
// Get the FL main window
368371
var hwnd = GetWindowHandle(Application.Current.MainWindow, true);
369372
if (hwnd == HWND.Null) return;

0 commit comments

Comments
 (0)