From 6268feb42ba4f2e2fa15484e88c9af60d254998c Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 30 Jul 2019 01:12:55 +0000 Subject: [PATCH] fixes #77922 --- src/vs/workbench/browser/layout.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 0ae7c7b1257..a213ed7b024 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -757,9 +757,17 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } const middleSection = root.children[1] as GridBranchNode; - this.state.sideBar.position = (middleSection.children[0] as GridLeafNode).view === this.activityBarPartView ? Position.LEFT : Position.RIGHT; - this.state.panel.position = isGridBranchNode(middleSection.children[2]) ? Position.BOTTOM : Position.RIGHT; + const sideBarPosition = (middleSection.children[0] as GridLeafNode).view === this.activityBarPartView ? Position.LEFT : Position.RIGHT; + if (sideBarPosition !== this.state.sideBar.position) { + throw new Error('Bad Grid'); + } + + const panelPosition = isGridBranchNode(middleSection.children[2]) || isGridBranchNode(middleSection.children[0]) ? Position.BOTTOM : Position.RIGHT; + if (panelPosition !== this.state.panel.position) { + throw new Error('Bad Grid'); + } } catch (err) { + workbenchGrid = undefined; console.error(err); } } @@ -1172,6 +1180,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } isPanelMaximized(): boolean { + if (!this.workbenchGrid) { + return false; + } + if (this.workbenchGrid instanceof Grid) { try { // The panel is maximum when the editor is minimum -- GitLab