From 96f550ceb8449fd59c713fc689bb442e29e32a4e Mon Sep 17 00:00:00 2001 From: Justin Willis Date: Mon, 30 Jan 2017 12:25:59 -0600 Subject: [PATCH] fix(content): check for this._scroll when reading dimensions (#10216) * fix(content): check for this._scroll * chore(lint): fix validate error --- src/components/content/content.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/content/content.ts b/src/components/content/content.ts index 8de56b998f..1c48a55595 100644 --- a/src/components/content/content.ts +++ b/src/components/content/content.ts @@ -605,6 +605,7 @@ export class Content extends Ion implements OnDestroy, OnInit { let cacheHeaderHeight = this._hdrHeight; let cacheFooterHeight = this._ftrHeight; let cacheTabsPlacement = this._tabsPlacement; + let scrollEvent: ScrollEvent; let tabsTop = 0; this._pTop = 0; this._pRight = 0; @@ -617,7 +618,11 @@ export class Content extends Ion implements OnDestroy, OnInit { this._fTop = 0; this._fBottom = 0; - const scrollEvent = this._scroll.ev; + // In certain cases this._scroll is undefined + // if that is the case then we should just return + if (!this._scroll) return; + + scrollEvent = this._scroll.ev; let ele: HTMLElement = this._elementRef.nativeElement; if (!ele) {