diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 5e5706656..e4972453f 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -896,7 +896,19 @@ namespace Flow.Launcher.Core.Plugin return false; } - var newMetadata = JsonSerializer.Deserialize(File.ReadAllText(metadataJsonFilePath)); + PluginMetadata newMetadata; + try + { + newMetadata = JsonSerializer.Deserialize(File.ReadAllText(metadataJsonFilePath)); + } + catch (Exception ex) + { + PublicApi.Instance.ShowMsgError(Localize.failedToInstallPluginTitle(plugin.Name), + Localize.pluginJsonInvalidOrCorrupted()); + PublicApi.Instance.LogException(ClassName, + $"Failed to deserialize plugin metadata for plugin {plugin.Name} from file {metadataJsonFilePath}", ex); + return false; + } if (SameOrLesserPluginVersionExists(newMetadata)) { diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 273c29950..26c9d35e0 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -234,6 +234,7 @@ Error creating setting panel for plugin {0}:{1}{2} {0} requires Flow {1}+ version to run Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it? We recommend updating Flow to the latest version to ensure that {0} works without issues. + Failed to install plugin because plugin.json is invalid or corrupted Plugin Store