Fixing invocation results for tasks whose result is `VoidTaskResult`

This commit is contained in:
Pawel Kadluczka 2016-11-02 22:34:21 -07:00
parent 5f23231d9b
commit 8d03c014fb
1 changed files with 5 additions and 2 deletions

View File

@ -144,9 +144,12 @@ namespace Microsoft.AspNetCore.SignalR
if (resultTask != null) if (resultTask != null)
{ {
await resultTask; await resultTask;
if (methodInfo.ReturnType.GetTypeInfo().IsGenericType)
{
var property = resultTask.GetType().GetProperty("Result"); var property = resultTask.GetType().GetProperty("Result");
invocationResult.Result = property?.GetValue(resultTask); invocationResult.Result = property?.GetValue(resultTask);
} }
}
else else
{ {
invocationResult.Result = result; invocationResult.Result = result;