From 8d03c014fb1dde2bbb77ddf06bf8b464c6b76dab Mon Sep 17 00:00:00 2001 From: Pawel Kadluczka Date: Wed, 2 Nov 2016 22:34:21 -0700 Subject: [PATCH] Fixing invocation results for tasks whose result is `VoidTaskResult` --- src/Microsoft.AspNetCore.SignalR/RpcEndpoint.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.SignalR/RpcEndpoint.cs b/src/Microsoft.AspNetCore.SignalR/RpcEndpoint.cs index a35b1b87e5..bf501c4193 100644 --- a/src/Microsoft.AspNetCore.SignalR/RpcEndpoint.cs +++ b/src/Microsoft.AspNetCore.SignalR/RpcEndpoint.cs @@ -144,8 +144,11 @@ namespace Microsoft.AspNetCore.SignalR if (resultTask != null) { await resultTask; - var property = resultTask.GetType().GetProperty("Result"); - invocationResult.Result = property?.GetValue(resultTask); + if (methodInfo.ReturnType.GetTypeInfo().IsGenericType) + { + var property = resultTask.GetType().GetProperty("Result"); + invocationResult.Result = property?.GetValue(resultTask); + } } else {