mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-11 22:53:16 +00:00
Small improvement
This commit is contained in:
parent
123b979aba
commit
c8dc7d3915
3 changed files with 3 additions and 5 deletions
|
@ -1530,7 +1530,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
DB db = DB.getInstance(context);
|
||||
EntityAttachment attachment = db.attachment().getAttachment(id);
|
||||
if (attachment == null)
|
||||
throw new FileNotFoundException();
|
||||
return null;
|
||||
File file = attachment.getFile(context);
|
||||
|
||||
ParcelFileDescriptor pfd = null;
|
||||
|
|
|
@ -38,7 +38,6 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -174,7 +173,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
|||
DB db = DB.getInstance(context);
|
||||
EntityAttachment attachment = db.attachment().getAttachment(id);
|
||||
if (attachment == null)
|
||||
throw new FileNotFoundException();
|
||||
return null;
|
||||
db.attachment().setDownloaded(id, null);
|
||||
attachment.getFile(context).delete();
|
||||
db.attachment().deleteAttachment(id);
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.io.BufferedOutputStream;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
@ -712,7 +711,7 @@ public class MessageHelper {
|
|||
AttachmentPart apart = attachments.get(index);
|
||||
EntityAttachment attachment = db.attachment().getAttachment(id);
|
||||
if (attachment == null)
|
||||
throw new FileNotFoundException();
|
||||
return;
|
||||
File file = attachment.getFile(context);
|
||||
|
||||
// Download attachment
|
||||
|
|
Loading…
Add table
Reference in a new issue