crash on cancel in tcs.SetResult(null); because tcs is null.
I have not determined the conditions that leads to this problem.
But it just happened while debugging on a xr device.
public void DocumentPicker_WasCancelled(object sender, EventArgs args)
{
var tcs = Interlocked.Exchange(ref this.completionSource, null);
tcs.SetResult(null);
}
Expected Behavior
don't crash on cancel
Actual Behavior
crash on cancel in tcs.SetResult(null); because tcs is null. I have not determined the conditions that leads to this problem. But it just happened while debugging on a xr device.
Specifications