mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #537 from Flow-Launcher/ContextMenuNullCheck
Check null for ContextMenu
This commit is contained in:
commit
71a6cd14ec
1 changed files with 12 additions and 6 deletions
|
|
@ -22,7 +22,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static List<PluginPair> AllPlugins { get; private set; }
|
||||
public static readonly HashSet<PluginPair> GlobalPlugins = new();
|
||||
public static readonly Dictionary<string, PluginPair> NonGlobalPlugins = new ();
|
||||
public static readonly Dictionary<string, PluginPair> NonGlobalPlugins = new();
|
||||
|
||||
public static IPublicAPI API { private set; get; }
|
||||
|
||||
|
|
@ -33,7 +33,10 @@ namespace Flow.Launcher.Core.Plugin
|
|||
/// <summary>
|
||||
/// Directories that will hold Flow Launcher plugin directory
|
||||
/// </summary>
|
||||
private static readonly string[] Directories = { Constant.PreinstalledDirectory, DataLocation.PluginsDirectory };
|
||||
private static readonly string[] Directories =
|
||||
{
|
||||
Constant.PreinstalledDirectory, DataLocation.PluginsDirectory
|
||||
};
|
||||
|
||||
private static void DeletePythonBinding()
|
||||
{
|
||||
|
|
@ -100,7 +103,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
try
|
||||
{
|
||||
var milliseconds = await Stopwatch.DebugAsync($"|PluginManager.InitializePlugins|Init method time cost for <{pair.Metadata.Name}>",
|
||||
() => pair.Plugin.InitAsync(new PluginInitContext(pair.Metadata, API)));
|
||||
() => pair.Plugin.InitAsync(new PluginInitContext(pair.Metadata, API)));
|
||||
|
||||
pair.Metadata.InitTime += milliseconds;
|
||||
Log.Info(
|
||||
|
|
@ -149,7 +152,10 @@ namespace Flow.Launcher.Core.Plugin
|
|||
if (NonGlobalPlugins.ContainsKey(query.ActionKeyword))
|
||||
{
|
||||
var plugin = NonGlobalPlugins[query.ActionKeyword];
|
||||
return new List<PluginPair> { plugin };
|
||||
return new List<PluginPair>
|
||||
{
|
||||
plugin
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -228,7 +234,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
try
|
||||
{
|
||||
results = plugin.LoadContextMenus(result);
|
||||
results = plugin.LoadContextMenus(result) ?? results;
|
||||
foreach (var r in results)
|
||||
{
|
||||
r.PluginDirectory = pluginPair.Metadata.PluginDirectory;
|
||||
|
|
@ -305,4 +311,4 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue