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

FilePicker Plugin for Xamarin and Windows
MIT License
74 stars 52 forks source link

File picker cancel causes error #75

Closed IeuanWalker closed 6 years ago

IeuanWalker commented 6 years ago

Xamarin.forms android Plugin - v1.2.1

If the user cancels selecting a file it causes a null reference exception

Here is my code -

try
{
        UserDialogs.Instance.ShowLoading("Loading");
        selectedFile = await CrossFilePicker.Current.PickFile();
}
catch (Exception ex)
{
        System.Diagnostics.Debug.WriteLine(ex);
}
finally
{
        UserDialogs.Instance.HideLoading();
}

if (selectedFile != null)
{
        // do stuff with file
}
// End of method where error is triggered

Here is the crash report from AppCentre

image

jfversluis commented 6 years ago

As mentioned in the before issue, development is discontinued here. Please open new issues on my account's repo.