From 6d9463801eec5434b2700a32ddb21e517b87fe28 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 7 Nov 2011 01:44:10 +0100 Subject: [PATCH] Don't call promptForServerPasswords() if we already know all passwords --- src/com/fsck/k9/activity/Accounts.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 45c622ee5..c6ef7b397 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -1383,11 +1383,15 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC List disabledAccounts = new ArrayList(); for (AccountDescriptionPair accountPair : mImportResults.importedAccounts) { Account account = preferences.getAccount(accountPair.imported.uuid); - if (!account.isEnabled()) { + if (account != null && !account.isEnabled()) { disabledAccounts.add(account); } } - activity.promptForServerPasswords(disabledAccounts); + if (disabledAccounts.size() > 0) { + activity.promptForServerPasswords(disabledAccounts); + } else { + activity.setNonConfigurationInstance(null); + } } }