1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-31 11:31:40 +00:00

Prevent crash on saving attachments

This commit is contained in:
M66B 2019-05-28 19:14:45 +02:00
parent 55c65eca7f
commit b420e83992

View file

@ -1669,12 +1669,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
for (EntityAttachment attachment : attachments) {
File file = attachment.getFile(context);
String name = attachment.name;
String name = Helper.sanitizeFilename(attachment.name);
if (TextUtils.isEmpty(name))
name = Long.toString(attachment.id);
DocumentFile document = tree.createFile(attachment.type, name);
if (document == null)
throw new FileNotFoundException(name);
throw new FileNotFoundException(uri + ":" + name);
ParcelFileDescriptor pfd = null;
OutputStream os = null;