diff --git a/app/src/main/java/eu/faircode/email/MessageClassifier.java b/app/src/main/java/eu/faircode/email/MessageClassifier.java index 482840f2b9..499c71bbb8 100644 --- a/app/src/main/java/eu/faircode/email/MessageClassifier.java +++ b/app/src/main/java/eu/faircode/email/MessageClassifier.java @@ -255,12 +255,17 @@ public class MessageClassifier { if (maxMatchedWords == 0) return null; + DB db = DB.getInstance(context); List chances = new ArrayList<>(); for (String clazz : classStats.keySet()) { Integer messages = classMessages.get(account).get(clazz); if (messages == null || messages == 0) continue; + EntityFolder folder = db.folder().getFolderByName(account, clazz); + if (folder == null) + continue; + Stat stat = classStats.get(clazz); double chance = (double) stat.totalFrequency / messages / maxMatchedWords; Chance c = new Chance(clazz, chance);