mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
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.
This commit is contained in:
parent
b02a5a265d
commit
590bf20204
1 changed files with 2 additions and 1 deletions
|
|
@ -899,7 +899,8 @@ namespace Flow.Launcher.Core.Plugin
|
|||
PluginMetadata newMetadata;
|
||||
try
|
||||
{
|
||||
newMetadata = JsonSerializer.Deserialize<PluginMetadata>(File.ReadAllText(metadataJsonFilePath));
|
||||
newMetadata = JsonSerializer.Deserialize<PluginMetadata>(File.ReadAllText(metadataJsonFilePath)) ??
|
||||
throw new JsonException("Deserialized metadata is null");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue