Skip to content

Commit

Permalink
fix(module:editor): fix destroying error when editor is not initializ…
Browse files Browse the repository at this point in the history
…ed (#4002)
  • Loading branch information
Wendell authored and vthinkxie committed Aug 14, 2019
1 parent 65a8ca3 commit a35fb09
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 a35fb09

Please sign in to comment.