Skip to content

Commit

Permalink
Merge pull request #223 from ckeditor/i/197
Browse files Browse the repository at this point in the history
Fix: Make sure that the watchdog instance exists before destroying itself. Closes #197.
  • Loading branch information
pomek authored Mar 8, 2021
2 parents cc88556 + 2bd48b5 commit 4ced4a8
Show file tree
Hide file tree
Showing 4 changed files with 610 additions and 410 deletions.
6 changes: 6 additions & 0 deletions src/ckeditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ export default class CKEditor extends React.Component {
* Destroys the editor by destroying the watchdog.
*/
_destroyEditor() {
// It may happen during the tests that the watchdog instance is not assigned before destroying itself. See: #197.
/* istanbul ignore next */
if ( !this.watchdog ) {
return;
}

this.watchdog.destroy();
this.watchdog = null;
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = {
test: /\.jsx$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
options: {
compact: false,
presets: [ '@babel/preset-react' ]
}
Expand Down
Loading

0 comments on commit 4ced4a8

Please sign in to comment.