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(); + } } }