From 590bf20204a969d595ecfa88556bbbd9a45c3c03 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 27 Feb 2026 18:53:30 +0800 Subject: [PATCH] Add null check for plugin metadata deserialization Throw a JsonException if deserializing plugin metadata from JSON returns null. This prevents null metadata from being used and improves error handling for invalid or corrupted plugin.json files. --- Flow.Launcher.Core/Plugin/PluginManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index f78b59360..36c63ab93 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -899,7 +899,8 @@ namespace Flow.Launcher.Core.Plugin PluginMetadata newMetadata; try { - newMetadata = JsonSerializer.Deserialize(File.ReadAllText(metadataJsonFilePath)); + newMetadata = JsonSerializer.Deserialize(File.ReadAllText(metadataJsonFilePath)) ?? + throw new JsonException("Deserialized metadata is null"); } catch (Exception ex) {