Prevent crash

pull/125/head
M66B 6 years ago
parent 1cc3d79ce9
commit ad7072e333

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

Loading…
Cancel
Save