Fix settings crash issue when clicking "Open Cmdpal settings..." (#39322)

Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
This commit is contained in:
Shawn Yuan
2025-05-09 10:06:19 +08:00
committed by GitHub
parent 0427a7a7b0
commit cdc5f073f0

View File

@@ -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}");
}
}