Ensure error gets shown even if connection to word processor has died

This commit is contained in:
Simon Kornblith 2012-05-30 00:12:03 -04:00
parent 2c2c1c797a
commit f7f5d8b9d6

View file

@ -664,12 +664,20 @@ Zotero.Integration = new function() {
}
if(displayError) {
var showErrorInFirefox = !document;
if(document) {
document.activate();
document.displayAlert(displayError,
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP,
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK);
} else {
try {
document.activate();
document.displayAlert(displayError,
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP,
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK);
} catch(e) {
showErrorInFirefox = true;
}
}
if(showErrorInFirefox) {
Zotero.Integration.activate();
Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService)
@ -1544,7 +1552,6 @@ Zotero.Integration.Fields.prototype.updateDocument = function(forceCitations, fo
ignoreCitationChanges, deleteCitations, callback));
}));
} catch(e) {
Zotero.logError(e);
Zotero.Integration.handleError(e, this._doc);
}
}