Skip to content

Commit c7cfd25

Browse files
committed
Ignore null value in deserialization to avoid unexpected nullreference issue
1 parent 908d1c4 commit c7cfd25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
5050
private static readonly JsonSerializerOptions options = new()
5151
{
5252
PropertyNameCaseInsensitive = true,
53+
IgnoreNullValues = true,
5354
Converters =
5455
{
5556
new JsonObjectConverter()
@@ -63,6 +64,8 @@ private async Task<List<Result>> DeserializedResultAsync(Stream output)
6364
var queryResponseModel = await
6465
JsonSerializer.DeserializeAsync<JsonRPCQueryResponseModel>(output, options);
6566

67+
await output.DisposeAsync();
68+
6669
return ParseResults(queryResponseModel);
6770
}
6871

0 commit comments

Comments
 (0)