diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index a1e8fe03b..c40f6576e 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -860,10 +860,18 @@ Zotero.Integration.Document.prototype._createNewSession = function(data) { */ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSetDocPrefs, callback) { var dataString = this._doc.getDocumentData(), + data, me = this; - if(!dataString) { + + if(dataString) { + try { + data = new Zotero.Integration.DocumentData(dataString); + } catch(e) {}; + } + + if(!data) { var haveFields = false; - var data = new Zotero.Integration.DocumentData(); + data = new Zotero.Integration.DocumentData(); if(require) { // check to see if fields already exist @@ -906,7 +914,6 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet callback(true); }); } else { - var data = new Zotero.Integration.DocumentData(dataString); if(data.dataVersion < DATA_VERSION) { if(data.dataVersion == 1 && data.prefs.fieldType == "Field"