From 5c93f105ea4744fe85aa6053f3a52986113f9e53 Mon Sep 17 00:00:00 2001 From: cketti Date: Sun, 23 Mar 2014 00:39:10 +0100 Subject: [PATCH] Avoid NullPointerException reported via Google Play --- src/com/fsck/k9/mail/store/LocalStore.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index e232c717d..5783449bd 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -772,9 +772,11 @@ public class LocalStore extends Store implements Serializable { public Long doDbWork(final SQLiteDatabase db) { final File[] files = attachmentDirectory.listFiles(); long attachmentLength = 0; - for (File file : files) { - if (file.exists()) { - attachmentLength += file.length(); + if (files != null) { + for (File file : files) { + if (file.exists()) { + attachmentLength += file.length(); + } } }