From 1d30f2387ec5603a3f0e8767a243dda4441644f9 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 6 Feb 2021 17:26:52 +0100 Subject: [PATCH] Find uid is optional on add --- app/src/main/java/eu/faircode/email/Core.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 0655ce776e..c5ff9a38d5 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -970,14 +970,18 @@ class Core { db.message().setMessageUid(message.id, null); // Some providers do not list the new message yet - Long found = findUid(ifolder, message.msgid, true); - if (found != null) - if (newuid == null) - newuid = found; - else if (!newuid.equals(found)) { - Log.w(folder.name + " Added=" + newuid + " found=" + found); - newuid = Math.max(newuid, found); - } + try { + Long found = findUid(ifolder, message.msgid, true); + if (found != null) + if (newuid == null) + newuid = found; + else if (!newuid.equals(found)) { + Log.w(folder.name + " Added=" + newuid + " found=" + found); + newuid = Math.max(newuid, found); + } + } catch (MessagingException ex) { + Log.w(ex); + } if (newuid != null && (message.uid == null || newuid > message.uid)) try {