From 0eedb5f800381c63f25f96e7753c7b8ccc013a7c Mon Sep 17 00:00:00 2001 From: Rafael Santana Date: Thu, 13 Jul 2017 14:20:16 -0300 Subject: [PATCH] fix(tabs): check if the subscription is defined before unsubscribe (#5667) --- src/lib/tabs/tab-nav-bar/tab-nav-bar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts b/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts index b292b7bf67e..bdd2600ea51 100644 --- a/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts +++ b/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts @@ -96,7 +96,10 @@ export class MdTabNav implements AfterContentInit, OnDestroy { ngOnDestroy() { this._onDestroy.next(); - this._resizeSubscription.unsubscribe(); + + if (this._resizeSubscription) { + this._resizeSubscription.unsubscribe(); + } } /** Aligns the ink bar to the active link. */