Explorar el Código

Prevent of destroying undefined wordcoutn container.

Mateusz Samsel hace 6 años
padre
commit
f32cfdf8f5
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      packages/ckeditor5-word-count/src/wordcount.js

+ 4 - 2
packages/ckeditor5-word-count/src/wordcount.js

@@ -136,8 +136,10 @@ export default class WordCount extends Plugin {
 	 * @inheritDoc
 	 */
 	destroy() {
-		this._outputView.element.remove();
-		this._outputView.destroy();
+		if ( this._outputView ) {
+			this._outputView.element.remove();
+			this._outputView.destroy();
+		}
 
 		super.destroy();
 	}