jfversluis / FilePicker-Plugin-for-Xamarin-and-Windows

FilePicker Plugin for Xamarin and Windows
MIT License
157 stars 80 forks source link

Carsh on cancel on iOS because tcs is null #196

Closed softlion closed 4 years ago

softlion commented 4 years ago

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.

   public void DocumentPicker_WasCancelled(object sender, EventArgs args)
        {
            var tcs = Interlocked.Exchange(ref this.completionSource, null);
            tcs.SetResult(null);
        }

Specifications

jfversluis commented 4 years ago

Closing this since this project will retire, please check out Xamarin.Essentials which now has a FilePicker based on this one.