Skip to content

Commit

Permalink
Removed invalid change.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomek committed Mar 8, 2021
1 parent 896b569 commit 3ff60a0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/ckeditor.jsx
Expand Up @@ -74,7 +74,7 @@ export default class CKEditor extends React.Component {

// Destroy the editor before unmouting the component.
componentWillUnmount() {
return this._destroyEditor();
this._destroyEditor();
}

// Render a <div> element which will be replaced by CKEditor.
Expand Down Expand Up @@ -157,19 +157,15 @@ export default class CKEditor extends React.Component {

/**
* Destroys the editor by destroying the watchdog.
*
* @returns {Promise}
*/
_destroyEditor() {
// It may happen during the tests that the watchdog instance is not assigned before destroying itself. See: #197.
if ( !this.watchdog ) {
return Promise.resolve();
return;
}

return this.watchdog.destroy()
.then( () => {
this.watchdog = null;
} );
this.watchdog.destroy();
this.watchdog = null;
}

/**
Expand Down

0 comments on commit 3ff60a0

Please sign in to comment.