Opened 16 years ago
Closed 16 years ago
#3267 closed Bug (fixed)
Exception in selection plugin when loading hidden editor
Reported by: | Josh Nisly | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | 3.0 Beta |
Keywords: | Confirmed Review+ | Cc: |
Description
If CKEditor is loaded in a hidden element, getRanges() in the selection plugin throws a JavaScript exception, since getNative returns null, and the return value isn't checked. Adding
if (sel === null) return [];
on line 447 of selection/plugin.js fixes the problem for me.
This problem can be duplicated in replace-by-class by adding "display: none" to the containing <p> element's style.
Attachments (1)
Change History (5)
comment:1 Changed 16 years ago by
Keywords: | Confirmed added |
---|---|
Milestone: | → CKEditor 3.0 |
comment:2 Changed 16 years ago by
Keywords: | Review? added |
---|
Changed 16 years ago by
Attachment: | 3267.patch added |
---|
comment:3 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
To check objects, it's not necessary to compare then with null. You did it well in line 580, but used a different style in line 525. Also, at that point you can safely check for "nativeRange", instead of "sel". In this way we make two checks in a single move.
So, for the addition at line 525:
Please make that change and go ahead committing it.