From 444d29506df334c2d00715043f9205474314a779 Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Thu, 20 Mar 2025 17:38:31 +0800 Subject: [PATCH] Update Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs Co-authored-by: Yan Li --- .../Plugin/JsonRPCPluginSettings.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs b/Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs index 5ca81e757..6496a413f 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs @@ -44,17 +44,16 @@ namespace Flow.Launcher.Core.Plugin // we need to convert it to the correct type foreach (var (key, value) in Settings) { - if (value is JsonElement jsonElement) + if (value is not JsonElement jsonElement) continue; + + Settings[key] = jsonElement.ValueKind switch { - Settings[key] = jsonElement.ValueKind switch - { - JsonValueKind.String => jsonElement.GetString() ?? value, - JsonValueKind.True => jsonElement.GetBoolean(), - JsonValueKind.False => jsonElement.GetBoolean(), - JsonValueKind.Null => null, - _ => value - }; - } + JsonValueKind.String => jsonElement.GetString() ?? value, + JsonValueKind.True => jsonElement.GetBoolean(), + JsonValueKind.False => jsonElement.GetBoolean(), + JsonValueKind.Null => null, + _ => value + }; } }