diff --git a/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs b/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs index 25d44b191..a3456aa48 100644 --- a/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs +++ b/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs @@ -2231,11 +2231,11 @@ protected override Task> InvokeAsyncImpl () } var tcs = new TaskCompletionSource> (); invokeAsyncResult = (IInvokeAsyncResult)obj.BeginInvokeMethod (ctx.Thread, function, args, optionsToInvoke, ar => { - if (Token.IsCancellationRequested) { - tcs.SetCanceled (); - return; - } try { + if (Token.IsCancellationRequested) { + tcs.SetCanceled (); + return; + } var endInvokeResult = obj.EndInvokeMethodWithResult (ar); tcs.SetResult (new SoftOperationResult (endInvokeResult.Result, false, endInvokeResult.OutArgs)); }