commit f7f5d8b9d67450a2fc18af1576d977ab4967171c
parent 2c2c1c797aa7606f8a9081d1d376ea04b15000d5
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 30 May 2012 00:12:03 -0400
Ensure error gets shown even if connection to word processor has died
Diffstat:
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
@@ -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);
}
}