From f61e9d389ff1f25c90a21c3a84a4867502a442b8 Mon Sep 17 00:00:00 2001 From: Divyansh Srivastava Date: Wed, 9 Sep 2020 11:33:28 -0700 Subject: [PATCH] catch unhandled FileNotFoundException exception (#6456) --- .../Microsoft.Plugin.Program/Programs/Win32Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs index 6b83aacc56..13a54a3cd2 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs @@ -484,6 +484,14 @@ namespace Microsoft.Plugin.Program.Programs return new Win32Program() { Valid = false, Enabled = false }; } + catch (FileNotFoundException e) + { + ProgramLogger.LogException( + $"|Win32|ExeProgram|{path}" + + $"|Unable to locate exe file at {path}", e); + + return new Win32Program() { Valid = false, Enabled = false }; + } } // Function to get the Win32 application, given the path to the application