Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#14613] prevent plugin initialization if editor was already destroyed… #273

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,10 @@

// Load all plugin specific language files in a row.
CKEDITOR.scriptLoader.load( languageFiles, function() {
//Ensure the editor has not been destroyed in the mean time
if (editor.status === 'destroyed') {
return;
}
// Initialize all plugins that have the "beforeInit" and "init" methods defined.
var methods = [ 'beforeInit', 'init', 'afterInit' ];
for ( var m = 0; m < methods.length; m++ ) {
Expand Down
4 changes: 4 additions & 0 deletions plugins/wysiwygarea/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@
doc = win.document,
body = doc.body;

//If the editor has been destroyed we should quit.
if (!editor) {
return;
}
// Remove helper scripts from the DOM.
var script = doc.getElementById( 'cke_actscrpt' );
script && script.parentNode.removeChild( script );
Expand Down