editor: handle situation when element doesn't implement getVerticallyFirstTextElement
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / canvas.js
index b234dd8..5bd5e85 100644 (file)
@@ -349,7 +349,7 @@ $.extend(Canvas.prototype, Backbone.Events, {
             if(byBrowser && byBrowser.parent().sameNode(nodeToLand)) {
                 return byBrowser;
             }
-            return e.getVerticallyFirstTextElement({considerChildren: false});
+            return _.isFunction(e.getVerticallyFirstTextElement) ? e.getVerticallyFirstTextElement({considerChildren: false}) : null;
         }.bind(this);
         var _markAsCurrent = function(element) {
             if(element instanceof documentElement.DocumentTextElement) {