From: Aleksander Ɓukasz Date: Tue, 16 Jul 2013 07:53:54 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e6bcea32d5cbbd948da1570615a0f6afa509e467?hp=ef3798eb62c7d42315da10c02ce75ba0b9232dd0 fix --- diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index a3d24a0..144417a 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -181,7 +181,7 @@ $.extend(Canvas.prototype, { params = _.extend({caretTo: 'end'}, params); var findFirstDirectTextChild = function(e, nodeToLand) { var byBrowser = this.getCursor().getPosition().element; - if(byBrowser.parent().sameNode(nodeToLand)) + if(byBrowser && byBrowser.parent().sameNode(nodeToLand)) return byBrowser; var children = e.children(); for(var i = 0; i < children.length; i++) {