From 0459d6e4fa67d8e7454893ff50826a17eefb7bdf Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Mon, 3 Jul 2023 12:58:44 +0800 Subject: [PATCH] fix v1 plugin issue - Settings NullReference - ExecutablePlugin not working --- Flow.Launcher.Core/Plugin/ExecutablePlugin.cs | 5 +++-- Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs index a7bbccfec..857122aa6 100644 --- a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs +++ b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.IO; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -27,14 +28,14 @@ namespace Flow.Launcher.Core.Plugin protected override Task RequestAsync(JsonRPCRequestModel request, CancellationToken token = default) { // since this is not static, request strings will build up in ArgumentList if index is not specified - _startInfo.ArgumentList[0] = request.ToString(); + _startInfo.ArgumentList[0] = JsonSerializer.Serialize(request, RequestSerializeOption); return ExecuteAsync(_startInfo, token); } protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default) { // since this is not static, request strings will build up in ArgumentList if index is not specified - _startInfo.ArgumentList[0] = rpcRequest.ToString(); + _startInfo.ArgumentList[0] = JsonSerializer.Serialize(rpcRequest, RequestSerializeOption); return Execute(_startInfo); } } diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index a3f58b5b9..97c3c8981 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -256,7 +256,7 @@ namespace Flow.Launcher.Core.Plugin { query.Search }, - Settings.Inner); + Settings?.Inner); var output = await RequestAsync(request, token);