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:
parent
dc476eb3e8
commit
edfae1906a
@ -354,7 +354,7 @@ public class SettingsImporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the account name is unique
|
// Make sure the account name is unique
|
||||||
String accountName = (account.name != null) ? account.name : "Imported";
|
String accountName = account.name;
|
||||||
if (isAccountNameUsed(accountName, accounts)) {
|
if (isAccountNameUsed(accountName, accounts)) {
|
||||||
// Account name is already in use. So generate a new one by appending " (x)", where x
|
// 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.
|
// 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);
|
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;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user