From c7cfd2581773b2fe8a9039532eb57f31115720c6 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Mon, 5 Jul 2021 11:47:56 +0800 Subject: [PATCH] Ignore null value in deserialization to avoid unexpected nullreference issue --- Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index 152173749..431458881 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -50,6 +50,7 @@ namespace Flow.Launcher.Core.Plugin private static readonly JsonSerializerOptions options = new() { PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, Converters = { new JsonObjectConverter() @@ -63,6 +64,8 @@ namespace Flow.Launcher.Core.Plugin var queryResponseModel = await JsonSerializer.DeserializeAsync(output, options); + await output.DisposeAsync(); + return ParseResults(queryResponseModel); }