[PTRun][Program]List special empty shortcuts (#17517)

This commit is contained in:
Jaime Bernardo
2022-04-05 11:17:48 +01:00
committed by GitHub
parent 1fc7a59b7c
commit 6f50a38e5f

View File

@@ -487,8 +487,14 @@ namespace Microsoft.Plugin.Program.Programs
var program = CreateWin32Program(path);
string target = ShellLinkHelper.RetrieveTargetPath(path);
if (!string.IsNullOrEmpty(target) && (File.Exists(target) || Directory.Exists(target)))
if (!string.IsNullOrEmpty(target))
{
if (!(File.Exists(target) || Directory.Exists(target)))
{
// If the link points nowhere, consider it invalid.
return InvalidProgram;
}
program.LnkResolvedPath = program.FullPath;
// Using CurrentCulture since this is user facing
@@ -515,11 +521,6 @@ namespace Microsoft.Plugin.Program.Programs
}
}
}
else
{
// If the link points nowhere, consider it invalid.
return InvalidProgram;
}
return program;
}