mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Return deep copy in GetNonGlobalPlugins to protect state
GetNonGlobalPlugins now returns a new dictionary with copied lists, preventing external modification of the internal _nonGlobalPlugins collection. This change improves encapsulation and safeguards plugin manager state integrity.
This commit is contained in:
parent
b8bc7fa82d
commit
8760fe29ee
1 changed files with 6 additions and 1 deletions
|
|
@ -588,7 +588,12 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static Dictionary<string, List<PluginPair>> GetNonGlobalPlugins()
|
||||
{
|
||||
return _nonGlobalPlugins.ToDictionary();
|
||||
var nonGlobalPlugins = new Dictionary<string, List<PluginPair>>();
|
||||
foreach (var kvp in _nonGlobalPlugins)
|
||||
{
|
||||
nonGlobalPlugins.Add(kvp.Key, [.. kvp.Value]);
|
||||
}
|
||||
return nonGlobalPlugins;
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetTranslationPlugins()
|
||||
|
|
|
|||
Loading…
Reference in a new issue