From: Aleksander Ɓukasz Date: Mon, 14 Jul 2014 12:42:37 +0000 (+0200) Subject: smartxml: Better check for document being successfulfy parsed X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/9f6d1535529f8d33732ecaac54bbd56afb536b0f smartxml: Better check for document being successfulfy parsed --- diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index b673865..b449d82 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -299,7 +299,7 @@ $.extend(TextNode.prototype, { var parseXML = function(xml) { var toret = $($.trim(xml)); - if(!toret.length) { + if(toret.length !== 1) { throw new Error('Unable to parse XML: ' + xml); } return toret[0];