From 5a5da39a1ed9d12cb4e7406306969e38b86d7d64 Mon Sep 17 00:00:00 2001 From: Manuel Mtz-Almeida Date: Thu, 15 Jun 2017 21:22:12 +0200 Subject: [PATCH] fix(highlight): selected tab might be null fixes #12054 --- src/components/tabs/tab-highlight.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/tab-highlight.ts b/src/components/tabs/tab-highlight.ts index 845d79968ef..0f7a8d09ff4 100644 --- a/src/components/tabs/tab-highlight.ts +++ b/src/components/tabs/tab-highlight.ts @@ -15,10 +15,13 @@ export class TabHighlight { constructor(private _elementRef: ElementRef, private _dom: DomController) {} select(tab: Tab) { + if (!tab) { + return; + } const dom = this._dom; dom.read(() => { - const btnEle: HTMLElement = tab.btn.getElementRef().nativeElement; + const btnEle: HTMLElement = tab.btn.getNativeElement(); const transform = `translate3d(${btnEle.offsetLeft}px,0,0) scaleX(${btnEle.offsetWidth})`; dom.write(() => {