File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ namespace CefSharp.Internals
16
16
/// </summary>
17
17
public class ConcurrentMethodRunnerQueue : IMethodRunnerQueue
18
18
{
19
+ private static Type VoidTaskResultType = Type . GetType ( "System.Threading.Tasks.VoidTaskResult" ) ;
19
20
private readonly IJavascriptObjectRepositoryInternal repository ;
20
21
private CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( ) ;
21
22
@@ -77,10 +78,14 @@ public void Enqueue(MethodInvocation methodInvocation)
77
78
{
78
79
if ( t . Status == TaskStatus . RanToCompletion )
79
80
{
80
- //TODO: Use resultTask.GetAwaiter().GetResult() instead
81
81
//We use some reflection to get the Result
82
82
//If someone has a better way of doing this then please submit a PR
83
83
result . Result = resultType . GetProperty ( "Result" ) . GetValue ( resultTask ) ;
84
+
85
+ if ( result . Result != null && result . Result . GetType ( ) == VoidTaskResultType )
86
+ {
87
+ result . Result = null ;
88
+ }
84
89
}
85
90
else
86
91
{
You can’t perform that action at this time.
0 commit comments