From e459c7c867cd0fb5ebb650e47bb48a9094a1fffc Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 23 Feb 2009 04:55:51 +0900 Subject: [PATCH] Escaping the error. A error occurs if the element has been removed when "elem.selectionStart" is executed. e.g. Press "gi" on --- common/content/editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 ()