Skip to content

Commit ae18d12

Browse files
committed
Additional check for file extension in windows search results
1 parent cabe944 commit ae18d12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ private static async IAsyncEnumerable<SearchResult> ExecuteWindowsIndexSearchAsy
4949
token.ThrowIfCancellationRequested();
5050
if (dataReader.GetValue(0) is DBNull
5151
|| dataReader.GetValue(1) is not string rawFragmentPath
52-
|| string.Equals(rawFragmentPath, "file:", StringComparison.OrdinalIgnoreCase))
52+
|| string.Equals(rawFragmentPath, "file:", StringComparison.OrdinalIgnoreCase)
53+
|| dataReader.GetValue(2) is not string extension)
5354
{
5455
continue;
5556
}
@@ -61,7 +62,7 @@ private static async IAsyncEnumerable<SearchResult> ExecuteWindowsIndexSearchAsy
6162
yield return new SearchResult
6263
{
6364
FullPath = path,
64-
Type = dataReader.GetString(2) == "Directory" ? ResultType.Folder : ResultType.File,
65+
Type = string.Equals(extension, "Directory", StringComparison.Ordinal) ? ResultType.Folder : ResultType.File,
6566
WindowsIndexed = true
6667
};
6768
}

0 commit comments

Comments
 (0)