mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
To catch URI Format Exception in PT Run (#6580)
* add a catch block for uri format exceptions * Added link to watson crash
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user