Skip to content

Commit

Permalink
fix(module:editor): fix destroying error when editor is not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendell committed Aug 14, 2019
1 parent 65a8ca3 commit 82bd729
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/code-editor/nz-code-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export class NzCodeEditorComponent implements OnDestroy, AfterViewInit {
}

ngOnDestroy(): void {
this.editorInstance.dispose();
if (this.editorInstance) {
this.editorInstance.dispose();
}

this.destroy$.next();
this.destroy$.complete();
Expand Down

0 comments on commit 82bd729

Please sign in to comment.