From bc823b3ca44ff4fb730060fe2949e3c27f4de98d Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 30 Mar 2025 15:04:07 +0800 Subject: [PATCH] Fix Application.Current null exception --- Flow.Launcher.Infrastructure/Win32Helper.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index b5b89e2d1..f260b17d1 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -364,6 +364,9 @@ namespace Flow.Launcher.Infrastructure // No installed English layout found if (enHKL == HKL.Null) return; + // When application is exiting, the Application.Current will be null + if (Application.Current == null) return; + // Get the FL main window var hwnd = GetWindowHandle(Application.Current.MainWindow, true); if (hwnd == HWND.Null) return;