From 64701de5f95808e25d45dffde73725de468cb8e3 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 1 May 2012 09:54:10 -0400 Subject: [PATCH] Don't fail if user cancels setDocPrefs window that appears because a style doesn't exist --- chrome/content/zotero/xpcom/integration.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 6e3b88119..2777dbe3e 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -930,7 +930,11 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet // make sure style is defined if(e instanceof Zotero.Integration.DisplayException && e.name === "invalidStyle") { this._session.setDocPrefs(this._doc, this._app.primaryFieldType, - this._app.secondaryFieldType, function() { + this._app.secondaryFieldType, function(status) { + if(status === false) { + throw new Zotero.Integration.UserCancelledException(); + } + me._doc.setDocumentData(me._session.data.serializeXML()); me._session.reload = true; callback(true);