From a0dcad3c0f5cced43a5af5834a4facef150ae410 Mon Sep 17 00:00:00 2001 From: VTHINKXIE Date: Sat, 21 Oct 2017 01:45:37 -0500 Subject: [PATCH] fix(module:dropdown): fix unsubscribe undefined bug (#464) close #269 --- src/components/dropdown/nz-dropdown.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/dropdown/nz-dropdown.component.ts b/src/components/dropdown/nz-dropdown.component.ts index 00d6f659af2..cddc519221d 100644 --- a/src/components/dropdown/nz-dropdown.component.ts +++ b/src/components/dropdown/nz-dropdown.component.ts @@ -154,7 +154,9 @@ export class NzDropDownComponent implements OnInit, OnDestroy, AfterViewInit { } ngOnDestroy() { - this._subscription.unsubscribe(); + if (this._subscription) { + this._subscription.unsubscribe(); + } } ngAfterViewInit() {