From 72d2d24cec32a8c094b78d46f3e4e4c4d243ceef Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 19 Jan 2011 00:13:58 +0000 Subject: [PATCH] Fixed potential null pointer access --- src/com/fsck/k9/mail/store/LocalStore.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 11b6c48f9..d2e24ceb5 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -657,14 +657,16 @@ public class LocalStore extends Store implements Serializable } else { - Log.e(K9.LOG_TAG,"asked to compute account statistics for an impossible folder mode "+displayMode); + Log.e(K9.LOG_TAG, "asked to compute account statistics for an impossible folder mode " + displayMode); + stats.unreadMessageCount = 0; + stats.flaggedMessageCount = 0; + return null; } + cursor.moveToFirst(); - stats.unreadMessageCount = cursor.getInt(0); // message count - stats.flaggedMessageCount = cursor.getInt(1); // message count + stats.unreadMessageCount = cursor.getInt(0); + stats.flaggedMessageCount = cursor.getInt(1); return null; - - } finally {