From 032b625ed1901a71adb1932a7fde150543149a8c Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Wed, 27 May 2020 16:51:52 -0700 Subject: [PATCH] check undefined (#10596) --- src/sql/base/browser/ui/panel/panel.component.ts | 2 +- .../containers/dashboardNavSection.component.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/sql/base/browser/ui/panel/panel.component.ts b/src/sql/base/browser/ui/panel/panel.component.ts index 5fc2b49b1e..6c679c7279 100644 --- a/src/sql/base/browser/ui/panel/panel.component.ts +++ b/src/sql/base/browser/ui/panel/panel.component.ts @@ -53,7 +53,7 @@ let idPool = 0; selector: 'panel', template: `
-
+
diff --git a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.component.ts b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.component.ts index e6a0656960..517e97c493 100644 --- a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.component.ts +++ b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.component.ts @@ -149,10 +149,12 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh } public layout() { - const activeTabId = this._panel.getActiveTab; - const localtab = this._tabs.find(i => i.id === activeTabId); - this._cd.detectChanges(); - localtab.layout(); + if (this._tabs) { + const activeTabId = this._panel.getActiveTab; + const localtab = this._tabs.find(i => i.id === activeTabId); + this._cd.detectChanges(); + localtab.layout(); + } } public refresh(): void {