diff --git a/src/lib/tooltip/tooltip.ts b/src/lib/tooltip/tooltip.ts index 49aaabfbb9d8..692036d0efe2 100644 --- a/src/lib/tooltip/tooltip.ts +++ b/src/lib/tooltip/tooltip.ts @@ -270,7 +270,7 @@ export class MdTooltip implements OnDestroy { /** Handles the keydown events on the host element. */ _handleKeydown(e: KeyboardEvent) { - if (this._tooltipInstance!.isVisible() && e.keyCode === ESCAPE) { + if (e.keyCode === ESCAPE && this._tooltipInstance && this._tooltipInstance.isVisible()) { e.stopPropagation(); this.hide(0); }