rem: if (openWizard || prefillAccount || (zeroIdCount && wizardcallback)) { 
add: if (openWizard || prefillAccount || ((!gAnyValidIdentity) && wizardcallback)) { 
context: function verifyAccounts(wizardcallback) {//check to see if the function is called with the callback and if so set the global variable returnmycall to true    if(wizardcallback)		returnmycall = true;	var openWizard = false;    var prefillAccount;	var state=true;	var ret = true;        try {        var am = Components.classes[accountManagerContractID].getService(Components.interfaces.nsIMsgAccountManager);        var accounts = am.accounts;        // as long as we have some accounts, we're fine.        var accountCount = accounts.Count();        var invalidAccounts = getInvalidAccounts(accounts);        if (invalidAccounts.length > 0) {            prefillAccount = invalidAccounts[0];        } else {        }        // if there are no accounts, or all accounts are "invalid"        // then kick off the account migration        if (accountCount == invalidAccounts.length) {            try {                  var messengerMigrator = Components.classes[messengerMigratorContractID].getService(Components.interfaces.nsIMessengerMigrator);                   messengerMigrator.UpgradePrefs();                  // if there is a callback mechanism then inform parent window to shut itself down                  if (wizardcallback){                      state = false;                      WizCallback(state);                  }                  ret = false;            }            catch (ex) {                  // upgrade prefs failed, so open account wizard                  openWizard = true;            }        }        //We are doing openWizard if  MessengerMigration returns some kind of error        //(including those cases where there is nothing to migrate).        //prefillAccount is valid, if there is an invalid account already         //zeroIdCount is true when there is only one account and it has no identities        //usually that happens only when it is a local folder account        //wizardcallback is true only when verifyaccounts is called from compose window.        //the last condition in the if is so that we call account wizard only when the user        //has only a local folder and tries to compose mail.        if (openWizard || prefillAccount || (zeroIdCount && wizardcallback)) {            MsgAccountWizard(prefillAccount);		        ret = false;        }        // hack, set a time out to do this, so that the window can load first        setTimeout("showMailIntegrationDialog();",0);        return ret;    }    catch (ex) {        dump("error verifying accounts " + ex + "\n");        return false;    }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/50a556df9f5170147f759f8b0d5e2d0cf4eead3a/accountUtils.js/buggy/mailnews/base/prefs/resources/content/accountUtils.js