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
1616 /// </summary>
1717 public class ConcurrentMethodRunnerQueue : IMethodRunnerQueue
1818 {
19+ private static Type VoidTaskResultType = Type . GetType ( "System.Threading.Tasks.VoidTaskResult" ) ;
1920 private readonly IJavascriptObjectRepositoryInternal repository ;
2021 private CancellationTokenSource cancellationTokenSource = new CancellationTokenSource ( ) ;
2122
@@ -77,10 +78,14 @@ public void Enqueue(MethodInvocation methodInvocation)
7778 {
7879 if ( t . Status == TaskStatus . RanToCompletion )
7980 {
80- //TODO: Use resultTask.GetAwaiter().GetResult() instead
8181 //We use some reflection to get the Result
8282 //If someone has a better way of doing this then please submit a PR
8383 result . Result = resultType . GetProperty ( "Result" ) . GetValue ( resultTask ) ;
84+
85+ if ( result . Result != null && result . Result . GetType ( ) == VoidTaskResultType )
86+ {
87+ result . Result = null ;
88+ }
8489 }
8590 else
8691 {
You can’t perform that action at this time.
0 commit comments