rem:  if (promptService) promptService.alert(window, errorTitle, errorMsg); 
add: if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); 
context: function AttachFile(){//  dump("AttachFile()\n");	currentAttachment = "";	//Get file using nsIFilePicker and convert to URL    try {			var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);			fp.init(window, gComposeMsgsBundle.getString("chooseFileToAttach"), nsIFilePicker.modeOpen);			fp.appendFilters(nsIFilePicker.filterAll);			if (fp.show() == nsIFilePicker.returnOK) {			currentAttachment = fp.fileURL.spec;			dump("nsIFilePicker - "+currentAttachment+"\n");			}    }	catch (ex) {		dump("failed to get the local file to attach\n");	}  if (!(DuplicateFileCheck(currentAttachment)))	  AddAttachment(currentAttachment, null);  else  {    dump("###ERROR ADDING DUPLICATE FILE \n");    var errorTitle = gComposeMsgsBundle.getString("DuplicateFileErrorDlogTitle");    var errorMsg = gComposeMsgsBundle.getString("DuplicateFileErrorDlogMessage");    if (promptService)      promptService.alert(window, errorTitle, errorMsg);    else      window.alert(errorMsg);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/58c2cb97b722e415727774a9972e3080113344e5/MsgComposeCommands.js/buggy/mailnews/compose/resources/content/MsgComposeCommands.js