1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-31 15:20:09 -05:00

Make sure we always have an account name when importing settings

This avoids a NullPointerException in the dialog that allows selecting
which accounts to import.
This commit is contained in:
cketti 2012-05-06 21:02:41 +02:00
parent dc476eb3e8
commit edfae1906a

View File

@ -354,7 +354,7 @@ public class SettingsImporter {
}
// Make sure the account name is unique
String accountName = (account.name != null) ? account.name : "Imported";
String accountName = account.name;
if (isAccountNameUsed(accountName, accounts)) {
// Account name is already in use. So generate a new one by appending " (x)", where x
// is the first number >= 1 that results in an unused account name.
@ -944,6 +944,11 @@ public class SettingsImporter {
Log.i(K9.LOG_TAG, "Skipping account with UUID " + uuid);
}
// If we couldn't find an account name use the UUID
if (account.name == null) {
account.name = uuid;
}
return account;
}