From 42a72fe8aafc86668a6d3765f0557f96d5cd14ef Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 4 Jan 2017 01:39:04 -0500 Subject: [PATCH] Don't leave document corrupted if error in doc prefs window And recover by showing the doc prefs window if it is corrupted (at least with an empty fieldType, which is what was happening previously) --- chrome/content/zotero/xpcom/integration.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index ef31ddc11..a44db382f 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -939,7 +939,8 @@ Zotero.Integration.Document.prototype._getSession = function _getSession(require } catch(e) {}; } - if(!data) { + // If no data or corrupted data, show doc prefs window again + if (!data || !data.prefs || !data.prefs.fieldType) { var haveFields = false; data = new Zotero.Integration.DocumentData(); @@ -2121,7 +2122,7 @@ Zotero.Integration.Session.prototype.setDocPrefs = function(doc, primaryFieldTyp return Zotero.Integration.displayDialog(doc, 'chrome://zotero/content/integration/integrationDocPrefs.xul', '', io) .then(function() { - if(!io.style) { + if (!io.style || !io.fieldType) { throw new Zotero.Exception.UserCancelled("document preferences window"); }