From eef485e63ee29d2f016ad022de806cbd14b906c3 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 25 Jun 2021 20:02:13 +0200 Subject: [PATCH] Oops --- app/src/main/java/eu/faircode/email/Core.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 22e73fe01c..465b8a46df 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2273,7 +2273,9 @@ class Core { // Get messages Message[] imessages = ifolder.getMessages(); List ids = db.message().getUidls(folder.id); - int max = (account.max_messages == null ? imessages.length : account.max_messages); + int max = (account.max_messages == null + ? imessages.length + : Math.min(imessages.length, account.max_messages)); EntityLog.log(context, folder.name + " POP" + " device=" + ids.size() +