Skip to content

Commit 444d295

Browse files
Jack251970Yusyuriv
andauthored
Update Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs
Co-authored-by: Yan Li <[email protected]>
1 parent afb38db commit 444d295

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@ public async Task InitializeAsync()
4444
// we need to convert it to the correct type
4545
foreach (var (key, value) in Settings)
4646
{
47-
if (value is JsonElement jsonElement)
47+
if (value is not JsonElement jsonElement) continue;
48+
49+
Settings[key] = jsonElement.ValueKind switch
4850
{
49-
Settings[key] = jsonElement.ValueKind switch
50-
{
51-
JsonValueKind.String => jsonElement.GetString() ?? value,
52-
JsonValueKind.True => jsonElement.GetBoolean(),
53-
JsonValueKind.False => jsonElement.GetBoolean(),
54-
JsonValueKind.Null => null,
55-
_ => value
56-
};
57-
}
51+
JsonValueKind.String => jsonElement.GetString() ?? value,
52+
JsonValueKind.True => jsonElement.GetBoolean(),
53+
JsonValueKind.False => jsonElement.GetBoolean(),
54+
JsonValueKind.Null => null,
55+
_ => value
56+
};
5857
}
5958
}
6059

0 commit comments

Comments
 (0)