Merge pull request #482 from pc223/fix-ambiguous-match-plugin-api

Fix AmbiguousMatchException when plugins call Flow API (JsonRPC)
This commit is contained in:
Kevin Zhang 2021-06-21 18:22:46 +08:00 committed by GitHub
commit 6b3f2e2ccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using System.Threading;
@ -128,7 +129,8 @@ namespace Flow.Launcher.Core.Plugin
private void ExecuteFlowLauncherAPI(string method, object[] parameters)
{
MethodInfo methodInfo = PluginManager.API.GetType().GetMethod(method);
var parametersTypeArray = parameters.Select(param => param.GetType()).ToArray();
MethodInfo methodInfo = PluginManager.API.GetType().GetMethod(method, parametersTypeArray);
if (methodInfo != null)
{
try