If you didn't pick any photo and clicked the back button on Pixel 5 simulator it will crash with null reference exception and the exception is not catchable even which is weird
public async Task<MediaFile> PickPhoto()
{
try
{
await CrossMedia.Current.Initialize();
if (!CrossMedia.Current.IsPickPhotoSupported)
{
throw new Exception(":not supported");
}
return await CrossMedia.Current.PickPhotoAsync();
}
catch(Exception ex) // this is not reachable
{
return null;
}
finally
{
Toast("Done"); // this is also not reachable
}
}
If you didn't pick any photo and clicked the back button on Pixel 5 simulator it will crash with null reference exception and the exception is not catchable even which is weird