File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,10 @@ function getWindowSubmenu(
312312 type : "separator" ,
313313 } ) ;
314314 for ( const tab of tabs ) {
315+ // Skip missing elements left by `delete this.tabs[index]` in
316+ // ServerManagerView.
317+ if ( tab === undefined ) continue ;
318+
315319 // Do not add functional tab settings to list of windows in menu bar
316320 if ( tab . role === "function" && tab . name === "Settings" ) {
317321 continue ;
@@ -700,15 +704,15 @@ async function checkForUpdate(): Promise<void> {
700704function getNextServer ( tabs : TabData [ ] , activeTabIndex : number ) : number {
701705 do {
702706 activeTabIndex = ( activeTabIndex + 1 ) % tabs . length ;
703- } while ( tabs [ activeTabIndex ] . role !== "server" ) ;
707+ } while ( tabs [ activeTabIndex ] ? .role !== "server" ) ;
704708
705709 return activeTabIndex ;
706710}
707711
708712function getPreviousServer ( tabs : TabData [ ] , activeTabIndex : number ) : number {
709713 do {
710714 activeTabIndex = ( activeTabIndex - 1 + tabs . length ) % tabs . length ;
711- } while ( tabs [ activeTabIndex ] . role !== "server" ) ;
715+ } while ( tabs [ activeTabIndex ] ? .role !== "server" ) ;
712716
713717 return activeTabIndex ;
714718}
You can’t perform that action at this time.
0 commit comments