Skip to content

Commit 27313cd

Browse files
committed
Fix unauthorize exception lead to the whole directory unable to index.
1 parent 98630d1 commit 27313cd

File tree

1 file changed

+7
-3
lines changed
  • Plugins/Flow.Launcher.Plugin.Program/Programs

1 file changed

+7
-3
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public List<Result> ContextMenus(IPublicAPI api)
131131
? $"/select,\"{FullPath}\""
132132
: Settings.ExplorerArgs;
133133

134-
Main.StartProcess(Process.Start,
134+
Main.StartProcess(Process.Start,
135135
new ProcessStartInfo(
136136
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer)
137137
? Main._settings.CustomizedExplorer
@@ -267,10 +267,14 @@ private static IEnumerable<string> ProgramPaths(string directory, string[] suffi
267267
return new string[] { };
268268
try
269269
{
270-
var paths = Directory.EnumerateFiles(directory, "*", SearchOption.AllDirectories)
270+
var paths = Directory.EnumerateFiles(directory, "*", new EnumerationOptions
271+
{
272+
IgnoreInaccessible = true,
273+
RecurseSubdirectories = true
274+
})
271275
.Where(x => suffixes.Contains(Extension(x)));
272-
return paths;
273276

277+
return paths;
274278
}
275279
catch (DirectoryNotFoundException e)
276280
{

0 commit comments

Comments
 (0)