Skip to content

Commit cabe944

Browse files
committed
Fix windows search empty paths
1 parent 1f1940a commit cabe944

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ private static async IAsyncEnumerable<SearchResult> ExecuteWindowsIndexSearchAsy
4747
while (await dataReader.ReadAsync(token))
4848
{
4949
token.ThrowIfCancellationRequested();
50-
if (dataReader.GetValue(0) == DBNull.Value || dataReader.GetValue(1) == DBNull.Value)
50+
if (dataReader.GetValue(0) is DBNull
51+
|| dataReader.GetValue(1) is not string rawFragmentPath
52+
|| string.Equals(rawFragmentPath, "file:", StringComparison.OrdinalIgnoreCase))
5153
{
5254
continue;
5355
}
5456
// # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path
55-
var encodedFragmentPath = dataReader
56-
.GetString(1)
57-
.Replace("#", "%23", StringComparison.OrdinalIgnoreCase);
57+
var encodedFragmentPath = rawFragmentPath.Replace("#", "%23", StringComparison.OrdinalIgnoreCase);
5858

5959
var path = new Uri(encodedFragmentPath).LocalPath;
6060

0 commit comments

Comments
 (0)