Skip to content

Commit

Permalink
fix(core): split view solo view crash (#9432)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Dec 30, 2024
1 parent 397a483 commit 79e0064
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export class Workbench extends Entity {
activeView$ = LiveData.computed(get => {
const activeIndex = get(this.activeViewIndex$);
const views = get(this.views$);
return views[activeIndex]; // todo: this could be null
// activeIndex could be out of bounds when reordering views
return views.at(activeIndex) || views[0];
});

location$ = LiveData.computed(get => {
return get(get(this.activeView$).location$);
});
Expand Down

0 comments on commit 79e0064

Please sign in to comment.