mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
[PTRun][Program]If win32 program redirection path is null, do not overwrite iconPath (#31170)
This commit is contained in:
@@ -930,15 +930,15 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
|
||||
private static bool TryGetIcoPathForRunCommandProgram(Win32Program program, out string icoPath)
|
||||
{
|
||||
icoPath = null;
|
||||
|
||||
if (program.AppType != ApplicationType.RunCommand)
|
||||
{
|
||||
icoPath = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(program.FullPath))
|
||||
{
|
||||
icoPath = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -946,6 +946,11 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
try
|
||||
{
|
||||
var redirectionPath = ReparsePoint.GetTarget(program.FullPath);
|
||||
if (string.IsNullOrEmpty(redirectionPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
icoPath = ExpandEnvironmentVariables(redirectionPath);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user