From e41691d10f539ee3f5e8acec07a1c5cd7c3adba9 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Fri, 4 Nov 2022 01:06:43 -0500 Subject: [PATCH] Fix everything sdk issue & a null reference issue --- .../Flow.Launcher.Plugin.Explorer.csproj | 6 ++++++ .../Search/Everything/EverythingApiDllImport.cs | 5 +++-- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index c4bcc90ab..51a0910b8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -25,6 +25,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingApiDllImport.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingApiDllImport.cs index f9eec929b..534afcb78 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingApiDllImport.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingApiDllImport.cs @@ -8,9 +8,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything { public static class EverythingApiDllImport { - public static void Load(string path) + public static void Load(string directory) { - int code = LoadLibrary(Path.Combine(path, DLL)); + var path = Path.Combine(directory, DLL); + int code = LoadLibrary(path); if (code == 0) { int err = Marshal.GetLastPInvokeError(); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 1d5c7a73e..f814214dd 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -36,7 +36,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search public int GetHashCode(Result obj) { - return obj.SubTitle.GetHashCode(); + return obj.SubTitle?.GetHashCode() ?? 0; } } @@ -167,7 +167,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search var useIndexSearch = Settings.IndexSearchEngine is Settings.IndexSearchEngineOption.WindowsIndex && UseWindowsIndexForDirectorySearch(locationPath); - + var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath); if (retrievedDirectoryPath.EndsWith(":\\"))