diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs index b93fb23c9..78c66d604 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs @@ -3,6 +3,7 @@ using System.Text; using System.Runtime.InteropServices; using Accessibility; using System.Runtime.InteropServices.ComTypes; +using Flow.Launcher.Plugin.Program.Logger; namespace Flow.Launcher.Plugin.Program.Programs { @@ -119,9 +120,19 @@ namespace Flow.Launcher.Plugin.Program.Programs // To set the app description if (!String.IsNullOrEmpty(target)) { - buffer = new StringBuilder(MAX_PATH); - ((IShellLinkW)link).GetDescription(buffer, MAX_PATH); - description = buffer.ToString(); + try + { + buffer = new StringBuilder(MAX_PATH); + ((IShellLinkW)link).GetDescription(buffer, MAX_PATH); + description = buffer.ToString(); + } + catch (COMException e) + { + // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception + ProgramLogger.LogException($"|IShellLinkW|retrieveTargetPath|{path}" + + "|Error caused likely due to trying to get the description of the program", + e); + } buffer.Clear(); ((IShellLinkW)link).GetArguments(buffer, MAX_PATH); diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 6b245d2c4..019048295 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -309,15 +309,6 @@ namespace Flow.Launcher.Plugin.Program.Programs return program; } - catch (COMException e) - { - // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception - ProgramLogger.LogException($"|Win32|LnkProgram|{path}" + - "|Error caused likely due to trying to get the description of the program", - e); - - return Default; - } catch (FileNotFoundException e) { ProgramLogger.LogException($"|Win32|LnkProgram|{path}" +