rem: 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; 
add: try { 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; 
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: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/215435b05a238a06e2df82da36df20bc5fbf582a/mail-offline.js/buggy/mailnews/base/resources/content/mail-offline.js