@@ -180,7 +180,7 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
180180 }
181181
182182 private updateRepresentedFilename ( ) : void {
183- const file = toResource ( this . editorService . activeEditor , { supportSideBySide : true , filter : 'file' } ) ;
183+ const file = toResource ( this . editorService . activeEditor || null , { supportSideBySide : true , filter : 'file' } ) ;
184184 const path = file ? file . fsPath : '' ;
185185
186186 // Apply to window
@@ -283,7 +283,7 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
283283 // Compute folder resource
284284 // Single Root Workspace: always the root single workspace in this case
285285 // Otherwise: root folder of the currently active file if any
286- const folder = this . contextService . getWorkbenchState ( ) === WorkbenchState . FOLDER ? workspace . folders [ 0 ] : this . contextService . getWorkspaceFolder ( toResource ( editor , { supportSideBySide : true } ) ) ;
286+ const folder = this . contextService . getWorkbenchState ( ) === WorkbenchState . FOLDER ? workspace . folders [ 0 ] : this . contextService . getWorkspaceFolder ( toResource ( editor || null , { supportSideBySide : true } ) ! ) ;
287287
288288 // Variables
289289 const activeEditorShort = editor ? editor . getTitle ( Verbosity . SHORT ) : '' ;
@@ -473,7 +473,7 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
473473
474474 const titleBackground = this . getColor ( this . isInactive ? TITLE_BAR_INACTIVE_BACKGROUND : TITLE_BAR_ACTIVE_BACKGROUND ) ;
475475 this . element . style . backgroundColor = titleBackground ;
476- if ( Color . fromHex ( titleBackground ) . isLighter ( ) ) {
476+ if ( titleBackground && Color . fromHex ( titleBackground ) . isLighter ( ) ) {
477477 addClass ( this . element , 'light' ) ;
478478 } else {
479479 removeClass ( this . element , 'light' ) ;
@@ -582,7 +582,7 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
582582 runAtThisOrScheduleAtNextAnimationFrame ( ( ) => this . adjustTitleMarginToCenter ( ) ) ;
583583
584584 if ( this . menubarPart ) {
585- const menubarDimension = new Dimension ( undefined , dimension . height ) ;
585+ const menubarDimension = new Dimension ( 0 , dimension . height ) ;
586586 this . menubarPart . layout ( menubarDimension ) ;
587587 }
588588 }
@@ -597,7 +597,7 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
597597 return super . layout ( dim1 ) ;
598598 }
599599
600- const dimensions = new Dimension ( dim1 , dim2 ) ;
600+ const dimensions = new Dimension ( dim1 , dim2 ! ) ;
601601 this . updateLayout ( dimensions ) ;
602602
603603 super . layout ( dimensions ) ;
0 commit comments