From 7ca476d6b026079cedb53e7d51c8b9d93dd68337 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:30:25 +0100 Subject: [PATCH] [PTRun][Program]If win32 program redirection path is null, do not overwrite iconPath (#31170) --- .../Microsoft.Plugin.Program/Programs/Win32Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 a54b4497f3..728edb4ecf 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs @@ -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; }