rem: var defaultAccount = accountManager.defaultAccount; 
add: var defaultAccount; try { defaultAccount = accountManager.defaultAccount; } catch (ex) {} 
context: function MigrateJunkMailSettings(){  var junkMailSettingsVersion = pref.getIntPref("mail.spam.version");  if (!junkMailSettingsVersion)  {    // get the default account, check to see if we have values for our     // globally migrated prefs.    var defaultAccount = accountManager.defaultAccount;    if (defaultAccount && defaultAccount.incomingServer)    {      // we only care about      var prefix = "mail.server." + defaultAccount.incomingServer.key + ".";      if (pref.prefHasUserValue(prefix + "manualMark"))        pref.setBoolPref("mail.spam.manualMark", pref.getBoolPref(prefix + "manualMark"));      if (pref.prefHasUserValue(prefix + "manualMarkMode"))        pref.setIntPref("mail.spam.manualMarkMode", pref.getIntPref(prefix + "manualMarkMode"));      if (pref.prefHasUserValue(prefix + "spamLoggingEnabled"))        pref.setBoolPref("mail.spam.logging.enabled", pref.getBoolPref(prefix + "spamLoggingEnabled"));      if (pref.prefHasUserValue(prefix + "markAsReadOnSpam"))        pref.setBoolPref("mail.spam.markAsReadOnSpam", pref.getBoolPref(prefix + "markAsReadOnSpam"));    }      // bump the version so we don't bother doing this again.    pref.setIntPref("mail.spam.version", 1);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10234/d027e4689d1933227390a26b26d3ddd8061f22fa/msgMail3PaneWindow.js/clean/mail/base/content/msgMail3PaneWindow.js