From 0b375ff86c1753c5cd5ffa9dfb8d9d1cb45742d4 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 29 Jul 2019 17:56:34 +0200 Subject: [PATCH] layout: add check --- src/vs/workbench/browser/layout.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index cfbafeba3f6..0ae7c7b1257 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -750,6 +750,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi workbenchGrid = SerializableGrid.deserialize(parsedGrid, { fromJSON }, { proportionalLayout: false }); const root = workbenchGrid.getViews(); + const titleBarSection = root.children[0]; + + if (isGridBranchNode(titleBarSection) || titleBarSection.view !== this.titleBarPartView) { + throw new Error('Bad grid'); + } + 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;