From: Aleksander Ɓukasz Date: Wed, 25 Jun 2014 08:22:46 +0000 (+0200) Subject: editor: fix X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/824b4e2265ab7fe8e30dc72feb5f299c28778da2 editor: fix --- diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index 50c0ae4..29edbe5 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -457,6 +457,9 @@ $.extend(Selection.prototype, { return doc.createFragment(doc.CaretFragment, {node: anchorNode, offset: this.nativeSelection.anchorOffset}); } if(this.type === 'textSelection') { + if(!anchorNode || !focusNode) { + return; + } if(anchorNode.isSiblingOf(focusNode)) { return doc.createFragment(doc.TextRangeFragment, { node1: anchorNode,