File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,26 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
60
60
var result = await cache . GetOrCreateAsync ( query . Search , async entry =>
61
61
{
62
62
var resultList = await Task . Run ( ( ) =>
63
- _win32s . Cast < IProgram > ( )
64
- . Concat ( _uwps )
65
- . AsParallel ( )
66
- . WithCancellation ( token )
67
- . Where ( HideUninstallersFilter )
68
- . Where ( p => p . Enabled )
69
- . Select ( p => p . Result ( query . Search , Context . API ) )
70
- . Where ( r => r ? . Score > 0 )
71
- . ToList ( ) ) ;
63
+ {
64
+ try
65
+ {
66
+ return _win32s . Cast < IProgram > ( )
67
+ . Concat ( _uwps )
68
+ . AsParallel ( )
69
+ . WithCancellation ( token )
70
+ . Where ( HideUninstallersFilter )
71
+ . Where ( p => p . Enabled )
72
+ . Select ( p => p . Result ( query . Search , Context . API ) )
73
+ . Where ( r => r ? . Score > 0 )
74
+ . ToList ( ) ;
75
+ }
76
+ catch ( OperationCanceledException )
77
+ {
78
+ // Fix #3091: System.OperationCanceledException Issue
79
+ return emptyResults ;
80
+ }
81
+
82
+ } ) ;
72
83
73
84
resultList = resultList . Any ( ) ? resultList : emptyResults ;
74
85
You can’t perform that action at this time.
0 commit comments