diff --git a/core/modules/ckeditor/js/ckeditor.js b/core/modules/ckeditor/js/ckeditor.js index d87982c..5a4547b 100644 --- a/core/modules/ckeditor/js/ckeditor.js +++ b/core/modules/ckeditor/js/ckeditor.js @@ -36,14 +36,7 @@ var label = $('label[for=' + element.getAttribute('id') + ']').html(); format.editorSettings.title = Drupal.t('Rich Text Editor, !label field', {'!label': label}); - var editor = false; - try { - editor = !!CKEDITOR.replace(element, format.editorSettings); - } - catch (e) { - editor = false; - } - return editor; + return !!CKEDITOR.replace(element, format.editorSettings); }, /** @@ -67,6 +60,10 @@ editor.updateElement(); } else { + // Try to destroy the CKEditor instance; this may fail if the CKEditor + // instance hasn't finished initializing yet, because initializing is + // asynchronous (by necessity, because it needs to load plugins, which + // themselves may need to load more things etc). try { editor.destroy(); element.removeAttribute('contentEditable');