From cabe944979b5680e7cfd52b65ecec958b4fdd11b Mon Sep 17 00:00:00 2001 From: Phoenix Date: Mon, 7 Aug 2023 15:18:49 +0300 Subject: [PATCH] Fix windows search empty paths --- .../Search/WindowsIndex/WindowsIndex.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs index 8aca5929d..7dde4cf99 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs @@ -47,14 +47,14 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex while (await dataReader.ReadAsync(token)) { token.ThrowIfCancellationRequested(); - if (dataReader.GetValue(0) == DBNull.Value || dataReader.GetValue(1) == DBNull.Value) + if (dataReader.GetValue(0) is DBNull + || dataReader.GetValue(1) is not string rawFragmentPath + || string.Equals(rawFragmentPath, "file:", StringComparison.OrdinalIgnoreCase)) { continue; } // # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path - var encodedFragmentPath = dataReader - .GetString(1) - .Replace("#", "%23", StringComparison.OrdinalIgnoreCase); + var encodedFragmentPath = rawFragmentPath.Replace("#", "%23", StringComparison.OrdinalIgnoreCase); var path = new Uri(encodedFragmentPath).LocalPath;