open editors: focus active group even if it does not have an editor. Make sure list is not empty

fixes #56806
This commit is contained in:
isidor
2018-08-21 10:27:42 +02:00
parent 07796186d3
commit eea3e8adf4
@@ -389,7 +389,7 @@ export class OpenEditorsView extends ViewletPanel {
}
private focusActiveEditor(): void {
if (this.editorGroupService.activeGroup && this.editorGroupService.activeGroup.activeEditor /* could be empty */) {
if (this.list.length && this.editorGroupService.activeGroup) {
const index = this.getIndex(this.editorGroupService.activeGroup, this.editorGroupService.activeGroup.activeEditor);
this.list.setFocus([index]);
this.list.setSelection([index]);