From d884b601e226a7fa1662ff34a23ebcfdb0374aa9 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 11 Aug 2018 14:03:43 +0000 Subject: [PATCH] Fixed FAB message list --- .../java/eu/faircode/email/FragmentMessages.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index c92d3fbce4..63746266bd 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -152,19 +152,25 @@ public class FragmentMessages extends FragmentEx { new SimpleLoader() { @Override - public Long onLoad(Bundle args) throws Throwable { + public Long onLoad(Bundle args) { long folder = (args == null ? -1 : args.getLong("folder", -1)); long thread = (args == null ? -1 : args.getLong("thread", -1)); // message ID DB db = DB.getInstance(getContext()); + Long account; if (thread < 0) if (folder < 0) return db.folder().getPrimaryDrafts().account; else - return db.folder().getFolder(folder).account; + account = db.folder().getFolder(folder).account; else - return db.message().getMessage(thread).account; + account = db.message().getMessage(thread).account; + + if (account == null) // outbox + account = db.folder().getPrimaryDrafts().account; + + return account; } @Override