From 3a1482d3335e4e472cb2745f60d0d23875bc364a Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 4 Jan 2019 08:59:14 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/ActivityView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 8b4ce9efd9..1bb4ca03ba 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -821,7 +821,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB @Override protected Long onExecute(Context context, Bundle args) { long account = args.getLong("account"); - return DB.getInstance(context).folder().getFolderByType(account, EntityFolder.INBOX).id; + DB db = DB.getInstance(context); + EntityFolder inbox = db.folder().getFolderByType(account, EntityFolder.INBOX); + return (inbox == null ? -1 : inbox.id); } @Override