X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/1a51f254c2c899b068ecfca66fd472ae79fadda3..83edceffb18f5802bb6a9b20746437a3a46f2450:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 1e3ae44..a5a1abc 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -665,8 +665,11 @@ $.extend(Document.prototype, Backbone.Events, fragments, { getNodeByPath: function(path) { var toret = this.root; - path.forEach(function(idx) { + path.some(function(idx) { toret = toret.contents()[idx]; + if(!toret) { + return true; + } }); return toret; },