diff --git a/common/content/editor.js b/common/content/editor.js index b24422bf..b62aad98 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -607,8 +607,12 @@ function Editor() //{{{ unselectText: function () { let elem = window.document.commandDispatcher.focusedElement; - if (elem && elem.selectionEnd) - elem.selectionEnd = elem.selectionStart; + // A error occurs if the element has been removed when "elem.selectionStart" is executed. + try { + if (elem && elem.selectionEnd) + elem.selectionEnd = elem.selectionStart; + } + catch (e) {} }, selectedText: function ()