Skip to content

Commit ff1d3c2

Browse files
committed
microsoft#29609 Check for split view existence
1 parent 81a9bb5 commit ff1d3c2

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

  • src/vs/workbench/parts/views/browser

src/vs/workbench/parts/views/browser/views.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,22 +359,22 @@ export class ComposedViewsViewlet extends Viewlet {
359359

360360
public getTitle(): string {
361361
let title = Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlet(this.getId()).name;
362-
if (this.hasSingleView()) {
362+
if (this.hasSingleView() && this.views[0]) {
363363
title += ': ' + this.views[0].name;
364364
}
365365
return title;
366366
}
367367

368368
public getActions(): IAction[] {
369-
if (this.hasSingleView()) {
369+
if (this.hasSingleView() && this.views[0]) {
370370
return this.views[0].getActions();
371371
}
372372
return [];
373373
}
374374

375375
public getSecondaryActions(): IAction[] {
376376
let actions = [];
377-
if (this.hasSingleView()) {
377+
if (this.hasSingleView() && this.views[0]) {
378378
actions = this.views[0].getSecondaryActions();
379379
}
380380

@@ -419,10 +419,12 @@ export class ComposedViewsViewlet extends Viewlet {
419419
}
420420

421421
private layoutViews(): void {
422-
this.splitView.layout(this.dimension.height);
423-
for (const view of this.views) {
424-
let viewState = this.createViewState(view);
425-
this.viewsStates.set(view.id, viewState);
422+
if (this.splitView) {
423+
this.splitView.layout(this.dimension.height);
424+
for (const view of this.views) {
425+
let viewState = this.createViewState(view);
426+
this.viewsStates.set(view.id, viewState);
427+
}
426428
}
427429
}
428430

@@ -580,6 +582,10 @@ export class ComposedViewsViewlet extends Viewlet {
580582
}
581583

582584
private onViewsUpdated(): TPromise<void> {
585+
if (!this.splitView) {
586+
return TPromise.as(null);
587+
}
588+
583589
if (this.hasSingleView()) {
584590
if (this.views[0]) {
585591
this.views[0].hideHeader();

0 commit comments

Comments
 (0)