Skip to content

Commit 0eedb5f

Browse files
rafaelss95jelbourn
authored andcommitted
fix(tabs): check if the subscription is defined before unsubscribe (#5667)
1 parent f57d00b commit 0eedb5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ export class MdTabNav implements AfterContentInit, OnDestroy {
9696

9797
ngOnDestroy() {
9898
this._onDestroy.next();
99-
this._resizeSubscription.unsubscribe();
99+
100+
if (this._resizeSubscription) {
101+
this._resizeSubscription.unsubscribe();
102+
}
100103
}
101104

102105
/** Aligns the ink bar to the active link. */

0 commit comments

Comments
 (0)