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 3e851ef008..2cb5604a85 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs @@ -376,7 +376,18 @@ namespace Microsoft.Plugin.Program.Programs if (line.StartsWith(urlPrefix, StringComparison.OrdinalIgnoreCase)) { urlPath = line.Substring(urlPrefix.Length); - Uri uri = new Uri(urlPath); + + try + { + Uri uri = new Uri(urlPath); + } + catch (UriFormatException e) + { + // To catch the exception if the uri cannot be parsed. + // Link to watson crash: https://watsonportal.microsoft.com/Failure?FailureSearchText=5f871ea7-e886-911f-1b31-131f63f6655b + ProgramLogger.LogException($"|Win32Program|InternetShortcutProgram|{urlPath}|url could not be parsed", e); + return new Win32Program() { Valid = false, Enabled = false }; + } // To filter out only those steam shortcuts which have 'run' or 'rungameid' as the hostname if (internetShortcutURLPrefixes.Match(urlPath).Success)