rem: var nextObj = Mail.lastSelected.next; 
add: var nextObj;  if (Mail.lastSelected == null) { Mail.findLastSelected(); }  nextObj = Mail.lastSelected.next; 
context: 	removeSelectedMessages : function() {		var detailsFrame = document.getElementById("portlet-mail-msg-detailed-frame");		var nextObj = Mail.lastSelected.next;		detailsFrame.src = "";				while (nextObj && nextObj.selected) {			nextObj = nextObj.next;		}				Mail.getSelectedMessages(Mail.removeSummary);		Mail.selectedArray = null;		Mail.resetLastSelected();				/* Hightlight next message */		if (nextObj != null) {			Mail.summaryHighlight(nextObj);			Mail.groupStart = nextObj;		}		else {			Mail.getFolderDetails();		}	},
meta: 10143	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10143/5fba061b8b15faed1a1b16eb0b88b00f76510390/mail.js/clean/portal-web/docroot/html/js/portlet/mail.js