From f369af268d62e7246fbce60830fa31c4b7cbb249 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 1 Jul 2012 15:43:47 -0400 Subject: [PATCH] Fix xml/dom mode, part 2 --- .../content/zotero/xpcom/translation/translate_firefox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 181f28d4e..442789d2b 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -467,7 +467,13 @@ Zotero.Translate.IO.Read.prototype = { "_getXML":function() { if(this._mode == "xml/dom") { - return Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + try { + var xml = Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + } catch(e) { + this._xmlInvalid = true; + throw e; + } + return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml); } else { return this._readToString().replace(/<\?xml[^>]+\?>/, ""); }