rem: var folderList = tree.selectedItems; if (folderList) 
add: var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); var expungedBytes = msgfolder.expungedBytes;  if (expungedBytes > 0) { if (gDBView) 
context: function MsgCompactFolder(isAll) {	//get the selected elements	var tree = GetFolderTree();    if (tree)    {        var folderList = tree.selectedItems;        if (folderList)        {            var folder = folderList[0];            if (folder)            {                dump("folder = " + folder.localName + "\n");                 var selectedFolderUri = folder.getAttribute('id');                var isImap=false;                if (selectedFolderUri.indexOf("imap:") != -1)                  isImap = true;                if (!isImap)  //can be local only                {                  var resource = RDF.GetResource(selectedFolderUri);                  var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);                  var expungedBytes = msgfolder.expungedBytes;                  if (expungedBytes > 0)                  {                     if (gDBView)                      gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage;                    ClearThreadPaneSelection();                    ClearThreadPane();                    ClearMessagePane();                  }                  else                  {                     if (!isAll)  //you have one local folder with no room to compact                       return;                  }                }                 try                {                  messenger.CompactFolder(tree.database, folder.resource, isAll);                }                catch(e)                {                  dump ("Exception : messenger.CompactFolder \n");                }             }	     }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/938770831965cde1ef5c4ce945b768186518efae/widgetglue.js/buggy/mailnews/base/resources/content/widgetglue.js