fix
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 07:53:54 +0000 (09:53 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 07:53:54 +0000 (09:53 +0200)
modules/documentCanvas/canvas/canvas.js

index a3d24a0..144417a 100644 (file)
@@ -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++) {