rem: for (var i=0; i< len; i++){ gPrefInt.DeleteBranch(gDeletedDirectories[i]); 
add: if (len) { try { var directoryServer = gPrefInt.CopyCharPref("ldap_2.autoComplete.directoryServer"); } catch(ex)  { directoryServer = null; } var am = Components.classes["@mozilla.org/messenger/account-manager;1"] .getService(Components.interfaces.nsIMsgAccountManager); if (am) { var allIdentities = am.allIdentities; var identitiesCount = allIdentities.Count(); var identityServer = new Array(); var currentIdenity = null; var j=0; for (j=0; j< identitiesCount; j++) { currentIdentity = allIdentities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity); identityServer[j] = {server:currentIdentity.directoryServer, deleted:false}; } var deletedGlobal = false; for (var i=0; i< len; i++){ if (!deletedGlobal && directoryServer && (gDeletedDirectories[i] == directoryServer)) { gPrefInt.SetCharPref("ldap_2.autoComplete.directoryServer", ""); deletedGlobal = true; } for (j=0; j<identitiesCount; j++){ if (identityServer[j].server && !identityServer[j].deleted && (gDeletedDirectories[i] == identityServer[j].server)) { identityServer[j].server = ""; identityServer[j].deleted = true; } } gPrefInt.DeleteBranch(gDeletedDirectories[i]); } gPrefInt.savePrefFile(null); } 
context: function onOK(){  var len = gDeletedDirectories.length;  for (var i=0; i< len; i++){    gPrefInt.DeleteBranch(gDeletedDirectories[i]);  }  window.close();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/bd468c0ddeed02897c0ce6e1cfb0841967f30cab/pref-directory.js/buggy/mailnews/addrbook/prefs/resources/content/pref-directory.js