From cdc5f073f07994b20a0c82a6c3b4037ddd2bd857 Mon Sep 17 00:00:00 2001 From: Shawn Yuan <128874481+shuaiyuanxx@users.noreply.github.com> Date: Fri, 9 May 2025 10:06:19 +0800 Subject: [PATCH] Fix settings crash issue when clicking "Open Cmdpal settings..." (#39322) Signed-off-by: Shawn Yuan --- .../Settings.UI/SettingsXAML/Views/CmdPalPage.xaml.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/CmdPalPage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/CmdPalPage.xaml.cs index a4c53d075c..275d5ef050 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/CmdPalPage.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/CmdPalPage.xaml.cs @@ -50,12 +50,15 @@ namespace Microsoft.PowerToys.Settings.UI.Views CreateNoWindow = false, }; - Process process = Process.Start(processStartInfo) ?? throw new InvalidOperationException("Failed to start the process."); - process.WaitForInputIdle(); + Process process = Process.Start(processStartInfo); + if (process == null) + { + Logger.LogError($"Failed to launch CmdPal settings page."); + } } catch (Exception ex) { - throw new InvalidOperationException($"Failed to launch CmdPal settings: {ex.Message}"); + Logger.LogError($"Failed to launch CmdPal settings: {ex.Message}"); } }