www

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

commit 176e2f2d0516f5fc65012b4be26bed4b18511808
parent b5b3d0a135c827c62aaa233d79e7478fabe78346
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon,  8 Aug 2011 22:27:50 +0000

Don't throw an error on CSL_BIBLIOGRAPHY codes


Diffstat:
Mchrome/content/zotero/xpcom/integration.js | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -1756,8 +1756,11 @@ Zotero.Integration.Session.prototype.restoreProcessorState = function() { * Loads document data from a JSON object */ Zotero.Integration.Session.prototype.loadBibliographyData = function(json) { + var openBraceIndex = json.indexOf("{"); + if(openBraceIndex == -1) return; + try { - var documentData = JSON.parse(json.substring(json.indexOf("{"), json.lastIndexOf("}")+1)); + var documentData = JSON.parse(json.substring(openBraceIndex, json.lastIndexOf("}")+1)); } catch(e) { try { var documentData = JSON.parse(json.substr(0, json.length-1));