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:
parent
55c65eca7f
commit
b420e83992
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue