diff --git a/src/com/fsck/k9/preferences/StorageExporter.java b/src/com/fsck/k9/preferences/StorageExporter.java index 64d8782b3..cda3c5f42 100644 --- a/src/com/fsck/k9/preferences/StorageExporter.java +++ b/src/com/fsck/k9/preferences/StorageExporter.java @@ -134,12 +134,15 @@ public class StorageExporter { Preferences preferences = Preferences.getPreferences(context); SharedPreferences storage = preferences.getPreferences(); + Set exportAccounts; if (accountUuids == null) { Account[] accounts = preferences.getAccounts(); - accountUuids = new HashSet(); + exportAccounts = new HashSet(); for (Account account : accounts) { - accountUuids.add(account.getUuid()); + exportAccounts.add(account.getUuid()); } + } else { + exportAccounts = accountUuids; } Map prefs = new TreeMap(storage.getAll()); @@ -151,7 +154,7 @@ public class StorageExporter { } serializer.startTag(null, ACCOUNTS_ELEMENT); - for (String accountUuid : accountUuids) { + for (String accountUuid : exportAccounts) { Account account = preferences.getAccount(accountUuid); writeAccount(serializer, account, prefs); }