Skip to content

Commit fb8daa4

Browse files
committed
Potential race condition in action keyword management
1 parent 04bd9dd commit fb8daa4

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,14 +648,7 @@ public static void AddActionKeyword(string id, string newActionKeyword)
648648
}
649649
else
650650
{
651-
if (_nonGlobalPlugins.TryGetValue(newActionKeyword, out var item))
652-
{
653-
_nonGlobalPlugins.TryUpdate(newActionKeyword, plugin, item);
654-
}
655-
else
656-
{
657-
_nonGlobalPlugins.TryAdd(newActionKeyword, plugin);
658-
}
651+
_nonGlobalPlugins.AddOrUpdate(newActionKeyword, plugin, (key, oldValue) => plugin);
659652
}
660653

661654
// Update action keywords and action keyword in plugin metadata

0 commit comments

Comments
 (0)