Skip to content

Commit 919c29d

Browse files
committed
fix(menu,tooltip): Ensure subscription exists before unsubscribing.
1 parent a02ed5a commit 919c29d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/lib/menu/menu-directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
6969
}
7070

7171
ngOnDestroy() {
72-
this._tabSubscription.unsubscribe();
72+
if (this._tabSubscription) {
73+
this._tabSubscription.unsubscribe();
74+
}
7375
}
7476

7577
/**

src/lib/tooltip/tooltip.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ export class MdTooltip implements OnInit, OnDestroy {
154154
this._disposeTooltip();
155155
}
156156

157-
this.scrollSubscription.unsubscribe();
157+
if (this.scrollSubscription) {
158+
this.scrollSubscription.unsubscribe();
159+
}
158160
}
159161

160162
/** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */

0 commit comments

Comments
 (0)