Handle uid not found

pull/184/head
M66B 4 years ago
parent e6f7063dd9
commit 9c13f2d97f

@ -752,6 +752,8 @@ class Core {
if (imessages != null && imessages.length > 0) if (imessages != null && imessages.length > 0)
try { try {
Message imessage = ifolder.getMessageByUID(message.uid); Message imessage = ifolder.getMessageByUID(message.uid);
if (imessage == null)
throw new MessageRemovedException();
imessage.setFlag(Flags.Flag.DELETED, true); imessage.setFlag(Flags.Flag.DELETED, true);
ifolder.expunge(); ifolder.expunge();
} catch (MessagingException ex) { } catch (MessagingException ex) {
@ -1032,6 +1034,8 @@ class Core {
if (uid != null) { if (uid != null) {
if (draft) { if (draft) {
Message icopy = itarget.getMessageByUID(uid); Message icopy = itarget.getMessageByUID(uid);
if (icopy == null)
continue;
// Mark read // Mark read
if (seen && !icopy.isSet(Flags.Flag.SEEN) && flags.contains(Flags.Flag.SEEN)) if (seen && !icopy.isSet(Flags.Flag.SEEN) && flags.contains(Flags.Flag.SEEN))

Loading…
Cancel
Save