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)
This commit is contained in:
parent
4ff5323acd
commit
42a72fe8aa
|
@ -939,7 +939,8 @@ Zotero.Integration.Document.prototype._getSession = function _getSession(require
|
||||||
} catch(e) {};
|
} 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;
|
var haveFields = false;
|
||||||
data = new Zotero.Integration.DocumentData();
|
data = new Zotero.Integration.DocumentData();
|
||||||
|
|
||||||
|
@ -2121,7 +2122,7 @@ Zotero.Integration.Session.prototype.setDocPrefs = function(doc, primaryFieldTyp
|
||||||
return Zotero.Integration.displayDialog(doc,
|
return Zotero.Integration.displayDialog(doc,
|
||||||
'chrome://zotero/content/integration/integrationDocPrefs.xul', '', io)
|
'chrome://zotero/content/integration/integrationDocPrefs.xul', '', io)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
if(!io.style) {
|
if (!io.style || !io.fieldType) {
|
||||||
throw new Zotero.Exception.UserCancelled("document preferences window");
|
throw new Zotero.Exception.UserCancelled("document preferences window");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user