From 38a38b185a0e5ad6e20c1e9de51399c25e1536f8 Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 10 Jul 2017 21:46:26 -0300 Subject: [PATCH] fix(tab-nav-bar): check if the subscription is not undefined --- 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 b0a3f56c3afe..5a568146c2bf 100644 --- a/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts +++ b/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts @@ -86,7 +86,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. */