rem: if(am) { allIdentities = am.allIdentities; identitiesCount = allIdentities.Count(); for (var i = 0; i < identitiesCount; i++) { currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity); msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity); if(msgFolder) {  numMessages = msgFolder.getTotalMessages(false); if(numMessages > 0) return true; } } 
add: if(am) { allIdentities = am.allIdentities; identitiesCount = allIdentities.Count(); for (var i = 0; i < identitiesCount; i++) { currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity); msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity); if(msgFolder) {  numMessages = msgFolder.getTotalMessages(false); if(numMessages > 0) return true; } } } } catch(ex) { 
context: function CheckForUnsentMessages(){  var am = Components.classes["@mozilla.org/messenger/account-manager;1"]               .getService(Components.interfaces.nsIMsgAccountManager);  var msgSendlater = Components.classes["@mozilla.org/messengercompose/sendlater;1"]               .getService(Components.interfaces.nsIMsgSendLater);  var identitiesCount, allIdentities, currentIdentity, numMessages, msgFolder;  if(am) {     allIdentities = am.allIdentities;    identitiesCount = allIdentities.Count();    for (var i = 0; i < identitiesCount; i++) {      currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity);      msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity);      if(msgFolder) {        // if true, descends into all subfolders         numMessages = msgFolder.getTotalMessages(false);        if(numMessages > 0) return true;      }    }   }  return false;}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/c628772766ad2c25aa206e723f956b965e45ad4b/mail-offline.js/clean/mailnews/base/resources/content/mail-offline.js