www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 42a72fe8aafc86668a6d3765f0557f96d5cd14ef
parent 4ff5323acd156cfbbe9fe99bbdafa157b0c2dff3
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed,  4 Jan 2017 01:39:04 -0500

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)

Diffstat:
Mchrome/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 @@ -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"); }