From 533738b248c839e03da2da5a853b1fe28cbc6d46 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 20 Sep 2018 01:43:29 +0200 Subject: [PATCH] Check for the anchorNode --- src/rich_text_editor/model/RichTextEditor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rich_text_editor/model/RichTextEditor.js b/src/rich_text_editor/model/RichTextEditor.js index d8d1a74da..d2b076378 100644 --- a/src/rich_text_editor/model/RichTextEditor.js +++ b/src/rich_text_editor/model/RichTextEditor.js @@ -38,7 +38,8 @@ const defActions = { title: 'Link' }, result: rte => { - const nextSibling = rte.selection().anchorNode.nextSibling; + const anchor = rte.selection().anchorNode; + const nextSibling = anchor && anchor.nextSibling; if (nextSibling && nextSibling.nodeName == 'A') { rte.exec('unlink'); } else {