1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Avoid NullPointerException reported via Google Play

This commit is contained in:
cketti 2014-03-23 00:39:10 +01:00
parent bd4b7d3664
commit 5c93f105ea

View File

@ -772,11 +772,13 @@ public class LocalStore extends Store implements Serializable {
public Long doDbWork(final SQLiteDatabase db) { public Long doDbWork(final SQLiteDatabase db) {
final File[] files = attachmentDirectory.listFiles(); final File[] files = attachmentDirectory.listFiles();
long attachmentLength = 0; long attachmentLength = 0;
if (files != null) {
for (File file : files) { for (File file : files) {
if (file.exists()) { if (file.exists()) {
attachmentLength += file.length(); attachmentLength += file.length();
} }
} }
}
final File dbFile = storageManager.getDatabase(uUid, database.getStorageProviderId()); final File dbFile = storageManager.getDatabase(uUid, database.getStorageProviderId());
return dbFile.length() + attachmentLength; return dbFile.length() + attachmentLength;