mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
Handle exception when adding attachment that does not exist on file system. (#449)
This commit is contained in:
parent
f0fb401d07
commit
60c5bbc73d
1 changed files with 12 additions and 5 deletions
|
@ -203,12 +203,19 @@ namespace Bit.Android
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using(var stream = ContentResolver.OpenInputStream(uri))
|
try
|
||||||
using(var memoryStream = new MemoryStream())
|
|
||||||
{
|
{
|
||||||
stream.CopyTo(memoryStream);
|
using(var stream = ContentResolver.OpenInputStream(uri))
|
||||||
MessagingCenter.Send(Xamarin.Forms.Application.Current, "SelectFileResult",
|
using(var memoryStream = new MemoryStream())
|
||||||
new Tuple<byte[], string>(memoryStream.ToArray(), fileName ?? "unknown_file_name"));
|
{
|
||||||
|
stream.CopyTo(memoryStream);
|
||||||
|
MessagingCenter.Send(Xamarin.Forms.Application.Current, "SelectFileResult",
|
||||||
|
new Tuple<byte[], string>(memoryStream.ToArray(), fileName ?? "unknown_file_name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Java.IO.FileNotFoundException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue