From 538cd76d8fa8df879b3ea541f23b211143809f20 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 15 Mar 2019 18:31:31 +0000 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/Core.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index a4139c06d2..07f0290b0b 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -532,7 +532,7 @@ class Core { if (itarget.getPermanentFlags().contains(Flags.Flag.SEEN)) { boolean seen = (autoread || message.ui_seen); icopy = itarget.getMessageByUID(uid); - if (seen != icopy.isSet(Flags.Flag.SEEN)) { + if (icopy != null && seen != icopy.isSet(Flags.Flag.SEEN)) { Log.i(target.name + " Fixing id=" + message.id + " seen=" + seen); icopy.setFlag(Flags.Flag.SEEN, seen); } @@ -542,7 +542,7 @@ class Core { if (itarget.getPermanentFlags().contains(Flags.Flag.DRAFT)) { boolean draft = EntityFolder.DRAFTS.equals(target.type); icopy = itarget.getMessageByUID(uid); - if (draft != icopy.isSet(Flags.Flag.DRAFT)) { + if (icopy != null && draft != icopy.isSet(Flags.Flag.DRAFT)) { Log.i(target.name + " Fixing id=" + message.id + " draft=" + draft); icopy.setFlag(Flags.Flag.DRAFT, draft); }