Browse Source

Prevent crash

main
M66B 6 years ago
parent
commit
ad7072e333
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      app/src/main/java/eu/faircode/email/FragmentMessages.java

+ 11
- 5
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -462,17 +462,23 @@ public class FragmentMessages extends FragmentEx {
new SimpleTask<Long>() {
@Override
protected Long onLoad(Context context, Bundle args) {
long folder = args.getLong("folder", -1);
long fid = args.getLong("folder", -1);
long thread = args.getLong("thread", -1); // message ID
DB db = DB.getInstance(context);
Long account = null;
if (thread < 0) {
if (folder >= 0)
account = db.folder().getFolder(folder).account;
} else
account = db.message().getMessage(thread).account;
if (folder >= 0) {
EntityFolder folder = db.folder().getFolder(fid);
if (folder != null)
account = folder.account;
}
} else {
EntityMessage threaded = db.message().getMessage(thread);
if (threaded != null)
account = threaded.account;
}
if (account == null) {
// outbox


Loading…
Cancel
Save