diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 199d4e7b1..e6b2bc2a2 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -380,7 +380,7 @@ namespace Flow.Launcher.Core.Plugin if (query is null) return Array.Empty(); - if (!GetNonGlobalPlugins().TryGetValue(query.ActionKeyword, out var plugins)) + if (TryGetNonGlobalPlugins(query.ActionKeyword, out var plugins)) { if (dialogJump) return [.. GetGlobalPlugins().Where(p => p.Plugin is IAsyncDialogJump && !PluginModified(p.Metadata.ID))]; @@ -395,6 +395,20 @@ namespace Flow.Launcher.Core.Plugin return [.. validPlugins]; } + private static bool TryGetNonGlobalPlugins(string actionKeyword, out List plugins) + { + if (_nonGlobalPlugins.TryGetValue(actionKeyword, out var list)) + { + lock (list) + { + plugins = [.. list]; + } + return true; + } + plugins = []; + return false; + } + public static ICollection ValidPluginsForHomeQuery() { return [.. _homePlugins.Where(p => !PluginModified(p.Metadata.ID))];