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