Opened 11 years ago

Closed 10 years ago

#841 closed defect (fixed)

Spell Checker - Won't return to xinha - error on line 40

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Plugin_SpellChecker Version: trunk
Severity: normal Keywords: spellchecker
Cc:

Description

I've been able to reproduce a bug in the Spell Checker that happens if you do the following:

Open the spell checker from xinha,
Replace a misspelled word with nothing (as in delete the suggested replacement and have it remove the word).
On clicking okay or cancel both IE and Firefox pop up an error.

Firebug for Firefox tells me
uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLBodyElement.insertBefore]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://www.phatassproduction.ca/xinha/plugins/SpellChecker/spell-check-ui.js :: makeCleanDoc :: line 40" data: no]
IE 6 and 7 just tell me it has an invalid pointer at line 40.

Change History (2)

comment:1 Changed 11 years ago by guest

I've figured out this change fixes it just fine without altering any other function:

Index: xinha/plugins/SpellChecker/spell-check-ui.js
===================================================================
--- xinha/plugins/SpellChecker/spell-check-ui.js        (revision 562)
+++ xinha/plugins/SpellChecker/spell-check-ui.js        (working copy)
@@ -37,7 +37,8 @@
   for (var i = words.length; --i >= 0;) {
     var el = words[i];
     if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
-      el.parentNode.insertBefore(el.firstChild, el);
+      if(el.firstChild)
+        el.parentNode.insertBefore(el.firstChild, el);
       el.parentNode.removeChild(el);
     } else
       el.className = "HA-spellcheck-fixed";

comment:2 Changed 10 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.