Fix everything sdk issue & a null reference issue

This commit is contained in:
Hongtao Zhang 2022-11-04 01:06:43 -05:00
parent 569cc19001
commit e41691d10f
No known key found for this signature in database
GPG key ID: 75F655B91C7AC9BB
3 changed files with 11 additions and 4 deletions

View file

@ -25,6 +25,12 @@
<None Include="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="EverythingSDK\x64\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="EverythingSDK\x86\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>

View file

@ -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();

View file

@ -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(":\\"))