Added message count fallback

pull/184/head
M66B 5 years ago
parent bd16ea9204
commit b4d2f79709

@ -2286,14 +2286,18 @@ public class MessageHelper {
static int getMessageCount(Folder folder) throws MessagingException {
// Keep alive
folder.getMessageCount();
int total = folder.getMessageCount();
try {
int count = 0;
for (Message message : folder.getMessages())
if (!message.isExpunged())
count++;
return count;
} catch (Throwable ex) {
Log.w(ex);
return total;
}
}
static String sanitizeKeyword(String keyword) {

Loading…
Cancel
Save