commit 083b3ba9a99526fb105bba36dad7e2e42931ab21
parent f4dfc13eabb45d59d82debc3bf60663440063319
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 9 Oct 2010 07:21:27 +0000
Prevent annoying error message from CTX detectWeb() if page isn't valid XML
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/translators/CTX.js b/translators/CTX.js
@@ -129,7 +129,12 @@ function detectInString(text) {
* specification.
*/
function contextObjectXMLToCOinS (text) {
- var doc = new XML(text);
+ try {
+ var doc = new XML(text);
+ }
+ catch (e) {
+ return [];
+ }
/* Here and elsewhere, we are using the E4X syntax for XML */
var objects = doc..*::["context-object"];