From 59c5a53aa4620df9d7611d0d22a6f54bf192a27b Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Fri, 22 Dec 2023 18:11:37 +0100 Subject: [PATCH] Add error log when plugin with the same id already exists --- src/DesktopMagic/MainWindow.xaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DesktopMagic/MainWindow.xaml.cs b/src/DesktopMagic/MainWindow.xaml.cs index 2cf0032..8eb3098 100644 --- a/src/DesktopMagic/MainWindow.xaml.cs +++ b/src/DesktopMagic/MainWindow.xaml.cs @@ -145,6 +145,12 @@ namespace DesktopMagic continue; } + if (plugins.ContainsKey(pluginMetadata.Id)) + { + App.Logger.Log($"Plugin \"{directory}\" has the same id as another plugin", "Main", LogSeverity.Error); + continue; + } + plugins.Add(pluginMetadata.Id, new(pluginMetadata, directory)); } }