File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
Plugins/Flow.Launcher.Plugin.Program/Programs Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 3
3
using System . Runtime . InteropServices ;
4
4
using Accessibility ;
5
5
using System . Runtime . InteropServices . ComTypes ;
6
+ using Flow . Launcher . Plugin . Program . Logger ;
6
7
7
8
namespace Flow . Launcher . Plugin . Program . Programs
8
9
{
@@ -119,9 +120,19 @@ public string retrieveTargetPath(string path)
119
120
// To set the app description
120
121
if ( ! String . IsNullOrEmpty ( target ) )
121
122
{
122
- buffer = new StringBuilder ( MAX_PATH ) ;
123
- ( ( IShellLinkW ) link ) . GetDescription ( buffer , MAX_PATH ) ;
124
- description = buffer . ToString ( ) ;
123
+ try
124
+ {
125
+ buffer = new StringBuilder ( MAX_PATH ) ;
126
+ ( ( IShellLinkW ) link ) . GetDescription ( buffer , MAX_PATH ) ;
127
+ description = buffer . ToString ( ) ;
128
+ }
129
+ catch ( COMException e )
130
+ {
131
+ // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception
132
+ ProgramLogger . LogException ( $ "|IShellLinkW|retrieveTargetPath|{ path } " +
133
+ "|Error caused likely due to trying to get the description of the program" ,
134
+ e ) ;
135
+ }
125
136
126
137
buffer . Clear ( ) ;
127
138
( ( IShellLinkW ) link ) . GetArguments ( buffer , MAX_PATH ) ;
Original file line number Diff line number Diff line change @@ -309,15 +309,6 @@ private static Win32 LnkProgram(string path)
309
309
310
310
return program ;
311
311
}
312
- catch ( COMException e )
313
- {
314
- // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception
315
- ProgramLogger . LogException ( $ "|Win32|LnkProgram|{ path } " +
316
- "|Error caused likely due to trying to get the description of the program" ,
317
- e ) ;
318
-
319
- return Default ;
320
- }
321
312
catch ( FileNotFoundException e )
322
313
{
323
314
ProgramLogger . LogException ( $ "|Win32|LnkProgram|{ path } " +
You can’t perform that action at this time.
0 commit comments