From b85c9b7b0edb6a36c53cc0d0db0b2b285cdcb3b1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 10 Jul 2011 14:27:36 -0400 Subject: [PATCH] Work around the fact that when we can't get read status for a message, we'd end up with an NPE as we then queried the hashmap --- src/com/fsck/k9/mail/store/WebDavStore.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/store/WebDavStore.java b/src/com/fsck/k9/mail/store/WebDavStore.java index 787e15790..9be88b78b 100644 --- a/src/com/fsck/k9/mail/store/WebDavStore.java +++ b/src/com/fsck/k9/mail/store/WebDavStore.java @@ -2124,10 +2124,14 @@ public class WebDavStore extends Store { for (String uid : mData.keySet()) { HashMap data = mData.get(uid); String readStatus = data.get("read"); - if (readStatus != null && - !readStatus.equals("")) { + if (readStatus != null && !readStatus.equals("")) { Boolean value = !readStatus.equals("0"); uidToRead.put(uid, value); + } else { + // We don't actually want to have null values in our hashmap, + // as it causes the calling code to crash with an NPE as it + // does a lookup in the maap. + uidToRead.put(uid, false); } }