Prevent crash on saving attachments

This commit is contained in:
M66B 2019-05-28 19:14:45 +02:00
parent 55c65eca7f
commit b420e83992
1 changed files with 2 additions and 2 deletions

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;